INN Autoconfigure
Overview of Changes.
There are four "source" files which should ship in the standard tar.
- config/config.scoreboard
This is the main source file. config.dist and config.data are generated files now.
NOTE TO INN-DEVELOPERS: DO NOT EDIT CONFIG.DIST or CONFIG.DATA
ALL CHANGES TO CONFIG.DATA SHOULD BE CHANGED IN CONFIG.SCOREBOARD.
config.scoreboard is used to generate:
config.data.in (used by the configure script to generate config.data)
config.dist
- configure.in
This is the configure generation script. Run through autoconf-2.12
- config/config.dist.subst
used to generate config.dist from config.data.in
- autoconf-inn.readme
external documentation of the above, describing action items remaining, migration paths, etc.
Additionally there are three "pre-generated files" which should ship in the standard tar. This will permit installation without autoconf. It will also allow configuration by editting config.dist (or config.data) by hand (without running configure.)
- configure
- config/config.data.in
- config/config.dist
Appropriate Makefile rules
(add to the appropriate Makefiles.)
configure: configure.in
/path-to-autoconf-2.12/autoconf -m/path-to-autoconf-2.12
And in the config/Makefile:
config.data.in: config.scoreboard
fgrep " ||" config.scoreboard | sed 's/ ||//g' >config.data.in
config.dist: config.data.in config.dist.subst
cp config.data.in config.dist
subst -f config.dist.subst config.dist
INN-autoconf Usage documentation
INN-autoconf Running the shell script
INN-autoconf Developer documentation
INN-autoconf Migration away from config.data
INN-autoconf config.scoreboard
INN-autoconf Software Action Items
INN-autoconf Completed Software Action Items
INN-autoconf Running the shell script
Requirements to run configure
- PATH variable must be set, to find awk, sh, Mail, etc.
- Some reasonable compiler must be in the path.
- /usr/ucb/cc is rejected as "bogus", even if it is a symlink to elsewhere.
- If gcc is on your system, then make sure it is in the path.
- configure requires config/config.data.in also
Procedure
- NOTE: MAKE A BACKUP COPY OF ANY config.data YOU INTEND TO SAVE.
It will be replaced when running configure!
- Run
(This will generate config/config.data)
- Edit config/config.data as appropriate. Items which are marked [autoconf] are either determined automatically
or can be adjusted with a command line parameter.
Command line options
To see a list of all command line parameters accepted as options:
configure --help | more
The options most likely to be changed from site to site:
--bindir=DIR user executables in DIR [EPREFIX/bin]
--mandir=DIR man documentation in DIR [PREFIX/man]
--enable-pgp-verify use pgp control verification
--with-tcl TCL script support
--with-perl Perl script support
--with-config-path=PATH Configurations pathname (default /var/news/etc)
--with-var-path=PATH Data files (history, etc) pathname (default /var/news/etc)
--with-run-path=PATH Running information pathname (default /var/news/run)
--with-lock-path=PATH Directory for file locking (default /var/news/lock)
--with-spool-dir=PATH News storage (default /var/news/spool)
--with-log-dir=PATH Logging directory (default /var/log/news)
--with-news-user=UID News user id (default news)
--with-news-group=GID News group id (default news)
--with-tmp-path=PATH Temporary files directory
INN-autoconf Migration away from config.data
Eventual goal: removal of config.data
config.data will go away when all of the following are true:
- all items which are confparam are supported in config.cache
- all items which are AC_SUBST are supported in config.cache.
configure.in forces a binary choice (either/or) for some items:
pid_t either int or pid_t
off_t either long or off_t
This is actually unacceptable.
- subst is not needed, and there are only AC_SUBST target files.
- all items which are WDF=fixed and WOR=yes are in inn.conf
(until then, config.data has the only way to change them.)
- documentation is moved elsewhere
Procedure for moving items out of config.data
- IMPORTANT: Edit only config.scoreboard.
- config.scoreboard is the place where all configurable items are documented, so even if something is removed,
or obsoleted, it might be better to comment it out, rather than deleting lines.
- Comment lines in config.scoreboard begin with the four character sequence:
' #||'
Procedure for adding items to config.data
- IMPORTANT: Edit only config.scoreboard.
- Should not want to do this very often. Only compile-time items should get added to config.data, every other configurable should be done through inn.conf. Want to move more items from [WDF=confparam][WOR=yes] to
[
WDF=fixed][WOR=yes]
Every WDF=confparam item requires an ac_cv_ and config.data variable. And possibly a inn.conf item. This is a lot of overhead, which should be minimized. If the default behavior will be acceptable or used in 95% of the installations, then it is appropriate to have the default be WDF=fixed, and change it via inn.conf at runtime.
- If the default is autoconf, or will be a AC_SUBST macro, then write the autoconf code for it. (See procedure for
adding items to configure.in)
Procedure for adding items to configure.in
Make sure the string tests are correct. May fail if not defined.
Procedure for changing config.dist
- IMPORTANT: Edit only config.scoreboard and config.dist.subst
- Change the default value by changing config.dist.subst
INN-autoconf config.scoreboard
Purpose of config.scoreboard
Line Syntax
- Lines beginning with the four characters ' ||' are written to config.data.in
- Lines beginning with the four characters ' #||' are comments, only appearing in config.scoreboard
- Beginning with a space allows easy parsing by custom development tools.
Each entry starts with a non-blank in column 0.
Entries
- Entries appear in the order they need to be written to config.data.in
- Each entry starts with a line with a non-blank character (a left square bracket='[') in column 0.
This describes
the location of the entry in the old config.data (for 1.7),
how the compiled-in default is selected.
whether run-time overriding is desired,
the priority for migration.
Descriptor tags
"IN1.7": ("Where it is now")
One of:
@config.data:section-number
fixed
not does not exist: (a new feature)
"WDF" Want-default: ("What selects the compile-time default")
One of:
fixed
autoconf (can be user-specified in config.cache also)
confparam (configure command line options. There are defaults if omitted)
"WOR" Want-override: ("How is the default behavior overridden")
One of
no Can only be changed at compile-time
yes run-time
"CUR" Current: ("Where it is in the 1.8-current tree" How much
progress has been made.)
1.7 (not ready. Still in the 1.7 state)
WDF Compile-time default is as wanted
WDF&inn.conf Compile-time default is as wanted, and can
be overridden via run-time code.
"P" PRIORITY: ("Priority for moving to the wanted location:")
One of
-- (complete)
high
moderate
low
Example:
[IN1.7=@4][WDF=autoconf][WOR=no][CUR=1.7][P=high]
||## How should non-blocking I/O be done? Pick IOCTL or FCNTL.
||#### =()<NBIO_STYLE @<NBIO_STYLE>@>()=
||NBIO_STYLE @DO_FIONBIO@
Requirements specification: INN configuration method
The current config.data serves a couple of purposes:
1. Allows configuration for compiler and operating system.
2. Allows selection of certain behavior of INN
(where directories are, CHECK_INCLUDED_TEXT, etc)
3. Documents the choices and selections of the settings.
4. Allows sharing and comparing with others using similar
systems. I.e. "It _is_ useful on other systems."
5. Provides an upgrade path for previous config.data, because
config.data is a subst "victim" file. (This is
why INN FAQ part 9 can be so "compact.")
6. Provides a great deal of frustration to first-time (and
some long time) INN administrators.
To make sure all AC_SUBST variables are replaced:
fgrep -v "#" config/config.auto | fgrep "@"
To get config.dist.subst from a standard config.data
fgrep -v "#" config/config.dist >config.dist.subst
Creating the dist file
cp config.auto.in config.dist
subst -f config.dist.subst config.dist
Compare the dist file
fgrep -v "##[autoconf]" <config.dist | sed 's/()=\[autoconf\]/()=/' >out
diff out config.dist.1.8
INN-autoconf Software Action Items
These are items which are not completed.
Tagged with severity:
[critical]
[defect]
[annoyance]
[improvement]
[wish]
[maintenance]
Or a completion tag:
[d] Done. completed
[reported] Should be changed elsewhere.
[partial]
[n] No longer wanted. Change in design, etc. Defferred.
Development tools/Maintenance Software Action Items
Need to test default and specified -with-dir items to make sure they work as intended.
[partial]Need to clean up variable names....Can have an ac_cv name, translated to an @SUBST@ name, translated to a
#define in a header file somewhere.
[annoyance]Get 4 errors when building... I think these are coming out of standard AUTOCONF macros...
configure.in:143: warning: AC_TRY_RUN called without default to allow cross compiling
configure.in:147: warning: AC_TRY_RUN called without default to allow cross compiling
configure.in:151: warning: AC_TRY_RUN called without default to allow cross compiling
configure.in:165: warning: AC_TRY_RUN called without default to allow cross compiling
Current config.data/INN Software action items
(discovered while doing this.)
[reported]_PATH_CONTROLPROGS is wrong directory for .pl and .tcl files.... Potential security problem.
[reported]Code in lib/closeonexec.c has to change, since CLX_STYLE can be fcntl even if FD_CLOEXEC was not defined. Should try to use FD_CLOEXEC if it exists.
#ifndef FD_CLOEXEC
#define FD_CLOEXEC 1
#endif
....
[n]Various stray spaces at end of lines.
Not reported but fixed in config.scoreboard
Usage and User-level features Software Action Items
(See also:Requirements specification: INN configuration method)
[annoyance]configure parameter validation:
Check that AC_ARG_WITH paths are not yes
[annoyance]Need to document how to not have such a long command line: (Use config.cache entries)
This action item severity level is considered "annoyance" since it can be changed in config.data
[annoyance]all command-line params must be available in config.cache
Not all with_ items are stored/overridable by config.cache.
This action item severity level is considered "annoyance" since it can be changed in config.data
[wish]Maybe could have a few profiles of uses...
Private server
Readerbox
feederbox
[wish]Should have a --with-fsstd option
[wish]Upgrade method using existing config.data or innshellvars.
From innshellvars only?
[wish]Must be able to be cross compiled.
sizeof tests without running
[n]How port settings from one system to another?
For this go-around, it is done through config.data.
[n]Documentation of what the acceptable values are for a choice.
Documentation of what values are configurable, and where to find them.
For now: config.scoreboard (which is shipped as config.data)
Software Action Items: configure.in and individual test mechanisms
[improvement]11-21-97 what about using innmail instead of Mail (like in 1.6b*) ?
[wish]autoconf man pages specify problem with link on some systems. Can this be tested? INN-autoconf test for link exit
[wish]Can the NBIO and CLX styles be tested? Perhaps let it as is.
[annoyance]Perhaps don't want AC_CACHE checks for NBIO and CLX. They can be unknown, which you don't want!
Solution is to delete config.cache, or prime it with reasonable values.
[annoyance]Not sure that all ac_cv_ items are being cached. Does this have to be specified? What happens with the AC_PATH_PROG mentioned items? Are they just subst targets or are they in config.cache also....
[partial] INN-autoconf: tests for LIBRARIES. Still may not be right.
[wish]Are LOCK_STYLE selections OK?
[annoyance]Perl/Tcl support has to be compiled in. So would be able to override to turn off, but not to turn on. Perhaps should have another inn.conf parameter....
[IN1.7=@17][WDF=confparam][WOR=no]
||## Do you want Perl support? Pick DO or DONT
||#### =()<PERL_SUPPORT @<PERL_SUPPORT>@>()=
||PERL_SUPPORT @DO_PERL@
[
wish]Items which should be autoconf, but are not yet.
[IN1.7=@4][WDF=autoconf][WOR=no]
||## What predicate, if any, the <ctype.h> macros need
||#### =()<CTYPE @<CTYPE>@>()=
||CTYPE (isascii((c)) && isXXXXX((c)))
||#CTYPE ((c) > 0 && isXXXXX((c)))
||#CTYPE isXXXXX((c))
[IN1.7=@4][WDF=autoconf][WOR=no]
||## Does your AF_UNIX bind use sizeof for the socket size? Pick DO or DONT.
||#### =()<BIND_USE_SIZEOF @<BIND_USE_SIZEOF>@>()=
||BIND_USE_SIZEOF DO
[IN1.7=@4][WDF=autoconf][WOR=no]
||## What is a file offset? MUST BE LONG FOR NOW.
||#### =()<OFFSET_T @<OFFSET_T>@>()=
||OFFSET_T long
[IN1.7=@4][WDF=autoconf][WOR=no]
||## Function that returns no value, and a pointer to it. Pick int or void
||#### =()<FUNCTYPE @<FUNCTYPE>@>()=
||FUNCTYPE void
[IN1.7=@6][WDF=autoconf][WOR=no]
||## What type of pointer does mmap() manage? Normally ``caddr_t'' or ``void *''
||## or ``char *''
||#### =()<MMAP_PTR @<MMAP_PTR>@>()=
||MMAP_PTR caddr_t
[IN1.7=@6][WDF=autoconf][WOR=no]
||## What type of pointer does mmap() manage? Normally ``caddr_t'' or ``void *''
||## or ``char *''
||#### =()<MMAP_PTR @<MMAP_PTR>@>()=
||MMAP_PTR caddr_t
[IN1.7=@6][WDF=autoconf][WOR=no]
||## Should we msync when using mmap? Pick DO or DONT. Useful
||## with some slightly broken mmap implementations. (like HPUX and BSD/OS).
||#### =()<MMAP_SYNC @<MMAP_SYNC>@>()=
||MMAP_SYNC DONT
[IN1.7=@6][WDF=autoconf][WOR=no]
||## Should we call your msync() with 3 args? (addr,len,flags)
||## Choose DO or DONT.
||#### =()<MSYNC_3_ARG @<MSYNC_3_ARG>@>()=
||MSYNC_3_ARG DONT
[IN1.7=@6][WDF=autoconf][WOR=no]
||## Do you have uustat, or just uuq? Pick DO or DONT
||#### =()<HAVE_UUSTAT @<HAVE_UUSTAT>@>()=
||HAVE_UUSTAT DO
[IN1.7=@6][WDF=autoconf][WOR=no]
||## Should INN do some setsockopts on network connections. Pick DO or DONT.
||## Some versions of Solaris should set to DONT (pre 2.4 it seems)
||#### =()<SET_SOCKOPT @<SET_SOCKOPT>@>()=
||SET_SOCKOPT DO
INN-autoconf Completed Software Action Items
This is useful as design documentation
[d]11/21/97 Changed to have target config.data.in, instead of config.auto.in
[d]11/17/97 separate.wri should be used to generate the new config.data. Definitely should be the source of the
config.auto.in This is to permit having only one source file to update....Use config.scoreboard
[d]Need to clean up the naming conventions.
[d]This means a reworking of the DODONT macro...
[d]11/21/97 Make it match 1.8. There are some items which changed default value from 1.7 to 1.8
LIBS changed to not have -lutil
HAVE_SETPROCTITLE changed to DO
HAVE_TM_GMTOFF changed to DO
CLX_STYLE changed to FCNTL
LEX added
[d]11/21/97 add LEX autoconf
[d]11/18/97 James wants everything in config.data in the order that it appears for 1.5.1
So need to generate from that....
Take entries from separate.wri and put them into config.dist, then build the distributed config.dst from that....
need to mark as "autoconf"
[d]Add support for VARPATH, data files
[d]Add support for VARPATH, data files
[d]Fixed AC_ARG_WITH macro arguments....
[d]Defaults should match config.dist
[d]Need some separate ETCPATH or something for config.data. with-varpath=
[d]Even when run using --with flags, some paths not selected?
[d]Socket test fails. What library needs to be linked? And why doesn't this fail instead of reporting "no"
[d]The echo \c stuff is not right. (Had to do with PATH mucking)
Development tools/Maintenance Software Action Items
[d]Need an easy way to compare config files
[d]Need way to find references to a value.... inn-1.7/srcfind inn-1.7/multfind
[d]Need to take the config file and separate out what goes where....
prefix config.dist (or maybe config.data.in)
tag, then
use MLSORT
[d]Need INN-autoconf config.scoreboard
Test and verification procedures
[d]Need to see how much config.data.in can be used to generate the standard config.dist
Need to test default and specified -with-dir items.
[partial]Need to clean up variable names....Can have an ac_cv name, translated to an @SUBST@ name, translated to a #definein a header file somewhere.
[d]DO_FIONBIO, and DO_FIOCLEX are poor names for subst variables.
Current config.data/INN Software action items
(discovered while doing this.)
[d]getdtab.c is always in libinn, so placing it into MISSING_SRC is a typo of the config.data comments
Usage and User-level features Software Action Items
[n]May want to "back out" some of the items which are set by command line params. There are too many....
[d]11/21/97 Commented out the path override
[n]How port settings from one system to another?
For this go-around, it is done through config.data.
Software Action Items: configure.in and individual test mechanisms
[d] convert_to_cv_subst macro was broken. Would have failed to work if direct.h
[d]The only way that wait3() is called is with the third argument NULL, so the wait3 RUSAGE check done by
AC_CHECK_WAIT3 is irrelevant. Changed it to use waitpid() if it exists.
[d]The current AC_HEADER_TIME test (used to generate NEEDTIME) defaults to DO. It is DONT only if there is a
problem. This is a variance from the usage in INN, but is probably safer....
INN-autoconf: tests for LIBRARIES
Removed -lelf -lresolv
to see what failed on Solaris 2.5
nlist() call from nnrpd/loadave.o
-lresolv is not needed, apparently on Solaris 2.5
Look through the nm output shows
gethostbyname2
inet_aton
Based on this, added AC_CHECK_LIB(elf, nlist)
Removed lib crypt test. Was only used for auth_progs.
1.5.1/config/config.data
-lutil
1.5.1/sample-configs/config.data-freebsd-2.0
-lgnumalloc
1.5.1/sample-configs/config.data-AUX 3.1
-lbsd
1.5.1/sample-configs/config.data-DYNIXPTX2.1
-lnsl -lsocket -lseq -linet -lnsl
1.5.1/sample-configs/config.data-IRIX-5.2
-lelf
1.5.1/sample-configs/config.data-NEWSOS-4.2.1
-lmld
1.5.1/sample-configs/config.data-Solaris2.3-4
-lnsl -lsocket -lelf -lresolv
1.5.1/sample-configs/config.data-SunOS-4.1.X
-lresolv
1.5.1/sample-configs/config.data-Ultrix4.3
-lresolve -l44bsd
1.5.1/sample-configs/config.data-UX4800
-lelf -lnsl -lsocket
1.5.1/sample-configs/config.data-UXPDS
-lnsl -lsocket -lelf
INN-autoconf test for link exit
From the Autoconv texinfo file
A few systems have linkers that do not return a failure exit status when there are unresolved functions in the link. This bug makes the configuration scripts produced by Autoconf unusable on those systems. However, some of them can be given options that make the exit status correct. This is a problem that Autoconf does not currently handle automatically. If users encounter this problem, they might be able to solve it by setting LDFLAGS in the environment to pass whatever options the linker needs (for example, '-Wl,-dn' on MIPS RISC/OS).
Can this be tested?