Desc: Configure options
File: configure.txt
Date: 7 December 2002
Auth: Russell Kroll <rkroll@exploits.org>

There are a few options that can be given to configure to tweak compiles:

 --prefix=PATH

   This is a fairly standard option with GNU autoconf, and it sets the
   base path for most of the other install directories.  The default
   is /usr/local/ups, which puts everything but the state files in one
   easy place.

   If you like having things to be at more of a "system" level, setting
   the prefix to /usr/local or even /usr might be better.

 --with-statepath=PATH

   Change the location of the state files created by the drivers.

   Default is /var/state/ups.

 --with-port=PORT

   Change the UDP and TCP ports used by the network code.  Default is 3493.

   Note: this used to be 3305, and you may have to set that manually
   in a mixed environment with versions of upsd from before 0.50.0.

 --with-user=<username>

   Programs started as root will setuid() to this user for somewhat 
   safer operation.  The default user is nobody.  

   Warning: Running lots of daemons as 'nobody' on your system isn't
   such a good idea.  You should create different users.  See the FAQ.

   Note: upsmon does not totally drop root as it needs to invoke a 
   shutdown.  There is always at least a stub process remaining with
   root powers.

 --with-group=<groupname>

   Programs started as root will setgid() to this group for safety.
   The default group is nogroup.

 --with-logfacility=FACILITY

   Change the facility used when writing to the log file.  Read the man
   page for openlog to get some idea of what's available on your system.
   Default is LOG_DAEMON.

 --without-mmap

   Disables mmap() on state files.  This is normally enabled, except on
   HP-UX.  If your system can't run and complains about mmap errors, 
   recompile with this switch and send in a bug report.

 --without-shared-memory

   Disables shared memory on the drivers and upsd.  This is useful
   on systems where the automatic detection fails, or for debugging.

   Shared memory is only used where mmap is not available, and will
   be going away eventually, so don't feel too bad if this doesn't work.

 --sysconfdir=PATH

   Changes the configuration path for the suite.  By default this path
   is $(prefix)/etc.  Setting this to /etc or /etc/ups might be useful.

 --mandir=PATH

   Sets the base directories for the man pages.  The default is
   $(prefix)/man, i.e. /usr/local/ups/man.

 --includedir=PATH

   Sets the path for include files.  Right now this is just upsclient.h.
   The default is $(prefix)/include.

 --libdir=PATH

   Sets the path for libraries.  This is just upsclient.o for now.
   The default is $(prefix)/lib.

 --with-pidpath=PATH

   Changes the directory where pid files are stored.  By default this is
   /var/run.  Certain programs like upsmon will leave files here.

 --with-altpidpath=PATH

   Programs that normally don't have root powers like the drivers and
   upsd write their pid files here.  By default this is whatever
   the statepath is, as those programs should be able to write there.

 --with-linux-hiddev=PATH

   Sets the directory to the hiddev.h for USB UPS support on Linux.
   This defaults to /usr/include/linux/hiddev.h, and is only used when
   building the experimental "hidups" driver.

 --with-drvpath=PATH

   The UPS drivers will be installed to this path.  By default they 
   install to "bin" under the prefix, giving a default path of
   /usr/local/ups/bin.

 --with-gd-includes="-I/foo/bar"

   If you installed gd in some place where your C preprocessor can't
   find the header files, use this switch to add additional -I flags.

 --with-gd-libs="-L/foo/bar -labcd -lxyz"

   If your copy of gd isn't linking properly, use this to give the
   proper -L and -l flags to make it work.  See LIBS= in gd's Makefile.

   This is not necessary if you have gd 2.0.8 or higher installed
   properly, as the gdlib-config script will be used.

 --with-cgi

   This switch tells configure to look for the libraries and headers
   that are used in the CGI programs.  This is not enabled by default,
   as it is not useful on many, if not most, systems.  You need to
   use this before 'make cgi' will work.

 --with-cgipath=PATH

   The CGI programs will be installed to this path.  By default, they
   install to "cgi-bin" under the prefix, which is usually /usr/local/ups.

   If you set the prefix to something like /usr, you should set the 
   cgipath to something else as /usr/cgi-bin is pretty ugly and 
   non-standard.

   The CGI programs are not built or installed by default.  Use "make cgi"
   to build them and "make install-cgi" to install them.

 --with-drivers=<driver>,<driver>,...

   As of the time of this writing, there are 30 UPS drivers available.
   Most users will only need one, a few will need two or three, and
   very few people will need all of them.

   To save time during the compile, and disk space later on, you can
   use this option to just build and install a subset of the drivers.
   To select apcsmart and hidups, do something like this:

   --with-drivers=apcsmart,hidups

   If you need to build more drivers later on, you will need to rerun
   configure with a different list.  To make it build all of the drivers
   again, run 'make distclean' before starting.
