Build details and troubleshooting
This file provides more detailed information about
compiling and installing the hpoj software,
including possible troubleshooting steps in case something goes wrong.
./configure script options
If the ./configure script has trouble finding components it needs,
or if you otherwise want to affect certain compile-time options, then you
may use the following command-line options:
Overrides the default installation path of /usr/local. The various
components are stored in the bin, include, lib,
sbin, and share/doc/hpoj
subdirectories under the specified path. Examples:
Normally the directories for ptal-mlcd
sockets and ptal-printd pipes are
placed in /var/run (hpoj-0.8 and earlier used /dev instead).
This option lets you change that.
These options let you disable parallel-port and/or USB support in
ptal-mlcd (the low-level I/O driver).
Since these options individually disable only a small amount of code,
there's little benefit in specifying them unless you otherwise experience
problems compiling or using ptal-mlcd.
Helps find the prefix path (above include and lib) for
Disables Linux-specific USB support (printer.o) to do all USB I/O
Helps find the location (not prefix path in this case)
of the SNMP include files. SNMP is needed to
fully support devices connected to an HP JetDirect print server.
It is assumed that the SNMP library libsnmp.so is accessible in
standard places. Example:
Helps find the directory where CUPS
backends are installed, if it's not one of
/usr/local/lib/cups/backend or /usr/lib/cups/backend.
Helps find the directories where SANE backends and .conf files are
Helps find the prefix path (above bin, include and
lib) for QT, and overrides any setting of the
QTDIR environment variable. QT is needed in order to compile the
xojpanel application. The specified
directory should contain include, bin, and lib
subdirectories which contain the corresponding components of QT. Examples:
Provides finer control than --with-qt=DIR over the search
for specific QT components.
The above --with-PACKAGE options may also take the form
--without-PACKAGE to disable use of the selected package
when it otherwise would have been used. Examples:
If you use one of the --without-PACKAGE switches, or if the
corresponding package can't be found, then the rest of the hpoj package
should still build, minus the parts that depend on the missing
Top-level Makefile targets
- "make all" (default) -- Same as "make check_generated
just_compile" (see below).
- "make check_generated" -- Does dependency checking on
./configure-generated files against their *.in sources.
- "make just_compile" -- Compiles code in all subdirectories.
- "make clean" -- Recursively deletes files created by "make
- "make distclean" -- Recursively deletes files created by
./configure and "make just_compile".
- "make install" -- Same as "make all just_install"
(see above and below).
- "make just_install" -- Same as "make user_install
root_install" (see below).
- "make user_install" -- Installs compiled code under installation
prefix (such as under /usr/local).
- "make root_install" -- Attempts to perform post-installation steps
under specific (non-prefix) directories, such as /etc, CUPS backend
directory, and SANE backend directory, and performs some additional checks
for missing or obsolete files.
If during make or "make install" you get an error trying to
create a symbolic link, then you are probably compiling and/or installing on
a file system that doesn't support symlinks, such as MSDOS or VFAT. Try
compiling and installing on a native Linux ext2 filesystem.
The compiler message "warning: parameter names (without types) in function
declaration" when compiling ptal-hpjd.c is normal.
As long as you invoke "make install" as root, it should
perform all of the necessary post-installation steps for you on many
distributions. This section is provided for your information in case you
can't install as root, or in case your distribution uses a
different (non-LSB) file-system layout or otherwise doesn't provide the
necessary tools to install the
Setting the PATH
"make install" invoked as root looks for the directory
/etc/profile.d and adds the scripts hpoj.sh and
hpoj.csh to this directory if it exists. These scripts add to
the PATH environment variable the bin and sbin
directories into which the hpoj software was installed. You'll need to
log out and back in again for the new PATH to take effect.
If for whatever
reason these scripts couldn't be added, then enter the following command on
the command line, or add it to /etc/profile (for all users) or to
~/.bash_profile (for individual users), and adjust /usr/local
as necessary for the actual installation directory you specified:
Configuring ptal-init to start
You can likely skip this section unless the
"make install" step reported an
error message to the effect that either the "SysV init script
directory" couldn't be found or chkconfig couldn't be run.
(Generally these aren't problems when compiling from source on RedHat
Linux and FreeBSD systems, or when installing onto any system a
pre-compiled package which properly sets this up for you.)
Caution: In order to prevent system-startup hangs and/or problems
setting up printing, take the following steps as root to ensure
that ptal-init gets started when your
system boots, and that it starts before your print spooler.
If your system uses SysV-style init scripts:
If your system doesn't use SysV-style init scripts, then consult your
distribution's documentation for information on how to add additional
start and stop commands to your system's startup and shutdown processes.
If all else fails, you might be able to add a line to some sort of "local"
init script, such as /etc/rc.d/rc.local, that invokes
"ptal-init start", but this will
likely not guarantee that
"ptal-init start" is run before
your print spooler. Also, you'll probably need to specify the full path
to ptal-init in this case.
- cd into either /etc/init.d or /etc/rc.d/init.d.
- Ensure that ptal-init is in this directory. It may be an
actual file or a symlink to somewhere else. Also, some package providers
may call it something else, such as hpoj or ptal. If you
don't find it here, then look for it where you installed hpoj (such as
/usr/local/sbin/ptal-init). Use this file in place of
- Run "ls -ld /etc/rc.d/rc*.d /etc/rc*.d" to look for all of the
runlevel init script directories. Some entries may be symlinks to other
- For each runlevel init script directory (not symlink) that you find:
- cd into that directory.
- Look for a symlink with a name of the form
<nn> is a number indicating the order in which things
are [S]tarted or [K]illed, and <module> is the name
of your print spooler, probably either lpd or cupsd.
- If you find a symlink to [S]tart your print spooler, then create a
[S]tart symlink for ptal-init with
a start-order number one less than that for your print spooler.
For example, if you found S60lpd, then issue a command such as
"ln -s ../init.d/ptal-init S59ptal-init".
- If you find a symlink to [K]ill your print spooler, then create a
[K]ill symlink for ptal-init with
a kill-order number one greater than that for your print spooler.
For example, if you found K60lpd, then issue a command such as
"ln -s ../init.d/ptal-init K61ptal-init".
Editing /etc/ld.so.conf and running ldconfig
"make install" as root checks /etc/ld.so.conf for
the directory into which libptal.so was installed, and adds it and
runs ldconfig if necessary. If you build and install several
times using --prefix=DIR switches that differ only in extra
slashes in the path, then you run the risk of having redundant lines added
to this file. It would probably be a good idea to inspect this file and make
corrections if necessary, and re-run ldconfig to make your changes
As an alternative to modifying /etc/ld.so.conf, you can set the
environment variable LD_LIBRARY_PATH to /usr/local/lib (or
wherever the libraries were installed) before running any of the
hpoj programs that depend on libptal.so.
Cleaning up from old hpoj versions
If you're upgrading from an older hpoj version, whether released or from
CVS, then there may be outdated files on your system. "make install"
checks for these under the installation directory and prints a message
asking you to delete any that it finds. However, it will not find them
if you install into a different directory from previous versions; in
this case, it would be a good idea to delete all files installed by the
If you install the hpoj software into separate unique directories
for different versions (such as /opt/hpoj-0.90, etc.),
then you should also check /etc/ld.so.conf
and remove lines that point to old hpoj versions. However, be careful not
to delete the line for the current version, or any line specifying a
path containing other libraries on your system that you want to continue
to be accessible. Run ldconfig (again, as root) to make
your changes to this file take effect.
Use the Back button on your browser to return to the previous document,
or click here to return to the