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 libusb.

Disables Linux-specific USB support (printer.o) to do all USB I/O through libusb.

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 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 installed, respectively.

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 functionality.

Top-level Makefile targets


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.

Post-installation steps

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 ptal-init script.

Setting the PATH

"make install" invoked as root looks for the directory /etc/profile.d and adds the scripts 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:
	export PATH=/usr/local/sbin:/usr/local/bin:$PATH

Configuring ptal-init to start at bootup

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.

Editing /etc/ and running ldconfig

"make install" as root checks /etc/ for the directory into which 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 take effect.

As an alternative to modifying /etc/, 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

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 previous version(s).

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/ 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.

Next steps

Use the Back button on your browser to return to the previous document, or click here to return to the index.