On Wed, 6 Apr 2016 22:37:09 -0400 (EDT) Daniel Herring dherring@tentpost.com wrote:
In terms of functionality and soundness of intent, the most advanced configuration tool I know of is GNU Autoconf. It provides a standard approach for running experiments on a system, providing default config selections, and providing user-selectable options. Unfortunately, it targets C/C++ and is written in "portable shell script" that is partially auto-generated by M4 and Perl. In other words, it is fairly hard to grok. Unfortunately, CL has nothing that even comes close in terms of functionality.
pkgsrc has a simple system where variables can be set by the binary-package-maintainer, that's higher level than autoconf. I wonder if ASDF or QuickLisp already has something similar, but if not, it could possibly be used as inspiration...
Here are example lines from a pkgsrc mk.conf file:
--- # Global control options [...] MAKE_JOBS=4 USE_SSP=yes X11_TYPE=native #MKDEBUG=yes #MKDEBUGLIB=yes DBG=-g -O2 INSTALL_UNSTRIPPED=yes PKG_RESUME_TRANSFERS=1 PKG_DEVELOPER=yes DISTDIR=/usr/distfiles PKGSRCDIR=/usr/pkgsrc WRKOBJDIR=/usr/pkgsrc-obj #PKGDBDIR=/var/db/pkg BINPKG_SITES=/usr/pkgsrc/packages/All [...]
# Acceptable licenses [...] ACCEPTABLE_LICENSES+=gnu-gpl-v2 [...]
# Default local options # imply -arts for any package with an arts option, # imply +inet6 for any package with an inet6 option, etc PKG_DEFAULT_OPTIONS=-arts -esound -nas -aalib -pulseaudio -gnome -hal -avahi -dbus mmx inet6
# Package-specific options [...] PKG_OPTIONS.irssi+=ssl perl inet6 PKG_OPTIONS.apache+=suexec -apache-mpm-worker PKG_OPTIONS.fluxbox+=xrender imlib2 xft PKG_OPTIONS.xterm+=freetype PKG_OPTIONS.squid+=squid-ipf squid-pf -snmp -squid-pam-helper PKG_OPTIONS.xmess+=sdl PKG_OPTIONS.ffmpeg+=faac opencore-amr PKG_OPTIONS.mutt+=ssl curses PKG_OPTIONS.emacs+=-gtk -x11 -motif -xaw PKG_OPTIONS.xlockmore+=oss PKG_OPTIONS.elinks+=x11 -javascript [...] PKG_OPTIONS.boehm-gc+=threads PKG_OPTIONS.ecl+=threads unicode ffi clx debug [...] ---
Of course, this is also implemented using the shell in this case, but a regexp tree with keywords, or something similar to *FEATURES* might also be an elegant way for users to specify package-specific (and global preferences) options...
Before building a package, the "show options" make-target allows to see available and default options for a package:
--- $ cd /usr/pkgsrc/lang/ecl/ $ make show-options
Any of the following general options may be selected: clx Enable the X11 support library. debug Enable debugging facilities in the package. ffi Enable dffi support. threads Enable threads support. unicode Enable support for Unicode.
These options are enabled by default: clx ffi unicode
These options are currently enabled: clx debug ffi threads unicode
You can select which build options to use by setting PKG_DEFAULT_OPTIONS or PKG_OPTIONS.ecl.
$ ---
Considering that with QL/ASDF the user also builds his Lisp packages, and might need a single location to specify options like accepted dependencies, pkgsrc options seem to answer the same problem.