netpbm

Toolkit for manipulation of graphic images, including conversion of images.
Comprises library libnetpbm.a and executables pbm*, pgm*, pnm*, ppm*.

Compilation

Needs gmake, libjpeg,libtiff,libpng,libz,perl.
The build procedure uses a non-Gnu configure script. It is rather "nonstandard", complex, cumbersome, and buggy at times.

V10.47.42

10.35.xx

Requires libpng to be older than V1.4.x.
  1. netpbm relies on the libpng-config script to configure the png library. Thus it must be in the command path, for example:
       export PATH=/nfs/local/71/libpng-1.2.50/bin:$PATH
    
    Moreover, libpng-config might need some modifications to reflect zlib usage:
       libs="-lpng12 -lz"
       I_opts="-I${includedir} -I/nfs/local/71/include"
    
  2. In Makefile.config.in modify:
       # for AIX: 
       CFLAGS= -O2 -qlanglvl=extc99 -D_LARGE_FILES
    
  3. Run the configure script and answer the prompts, for example (only non-default entries shown):
       ./configure  # creates Makefile.config
    
       static or shared [shared] ==> static
       '#include' argument or NONE [] ==> 
       library filename or 'none' [libjpeg.a] ==> /nfs/local/71/lib/libjpeg.a
       JPEG header directory [default] ==> /nfs/local/71/include
       library filename or 'none' [libtiff.a] ==> /nfs/local/71/lib/libtiff.a 
       TIFF header directory [default] ==> /nfs/local/71/include
       library filename or 'none' [libz.a] ==> /nfs/local/71/lib/libz.a
       Z header directory [default] ==> /nfs/local/71/include
    
  4. In Makefile.config modify:
       # disable (doesn't exist on AIX):
       #LDFLAGS += -L /usr/pubsw/lib
    
    If libtiff has been built with jbig support, in converter/other/Makefile add
       TIFFLIB_EXTRALIBS += -ljbig -llzma
    
  5. Run
       make
    
    It may be necessary in converter/pbm/thinkjettopbm.c to fix the missing / (around line 66, see comment) caused by an incorrect lex usage. (The maintainers don't bother to fix this obvious bug). Re-run make.
  6. If finally successful:
       make package pkgdir=/tmp/netpbm-10.35.89/ # some temporary installation 
       installnetpbm                             # just an option, not mandatory  
    

V10.26.xx


The build procedure uses a non-Gnu configure script. You will be prompted for the locations of support libraries (full name) and header directories (path).
Configuration parameters (compiler flags and such) may be changed afterwards in Makefile.config

Prerequisites

AIX 5.3 specifics

For some versions older than 10.35.80 in editor/pamperspective.c change
typedef enum {nearest, linear} interpolation;
to
typedef enum {interp_nearest, interp_linear} interpolation;
because nearest is a builtin function.

In other/pamx/window.c remove/outcomment

#include <X11/Xdefs.h>
this file does not exist and is not necessary.

HP-UX 10.20 / cc

Some versions older than 10.35.80 have a "design bug" in lib/libpm.c(pm_tmpfile): FILENAME_MAX is only 14 characters, which is too short. Change all occurences to PATH_MAX.

HP-UX 11.00 / gcc

It seems the 'configure' is not quite adapted. Inserting into pm_config.in.h
#if defined(__hpux)
#define UINT_FAST8_MAX	UINT_MAX
#define UINT_FAST16_MAX	USHRT_MAX
#define UINT_FAST64_MAX	ULLONG_MAX
#endif
is not sufficient, had to do it in converter/other/jpeg2000/libjasper/include/jasper/jas_types.h.

HP-UX 11.11 / cc


Strangely, in converter/ppm/ppmtompeg/psocket.c:
#include "pm_config.h" /* For POSIX_IS_IMPLIED */
#undef          _XOPEN_SOURCE_EXTENDED
to force usage of macros htonl and friends.
Insert into pm_config.in.h
#if defined(__hpux)
#define UINT_FAST8_MAX	UINT_MAX
#define UINT_FAST16_MAX	USHRT_MAX
#define UINT_FAST32_MAX	UINT_MAX
#define UINT_FAST64_MAX	ULLONG_MAX
#endif

Compilation

  1. Run the configure script, for example:
    export CC=cc              # native compiler
    configure                 # answer the questions
                              # prompts where I did not choose the default:
                              # (example for AIX 5.3) 
    Y or N (N) ==> Y
    static or shared [shared] ==> static
    library filename or 'none' [libjpeg.a] ==> /nfs/bio/local.AIX/53/lib/libjpeg.a
    JPEG header directory [default]        ==> /nfs/bio/local.AIX/53/include
    library filename or 'none' [libtiff.a] ==> /nfs/bio/local.AIX/53/lib/libtiff.a
    TIFF header directory [default]        ==> /nfs/bio/local.AIX/53/include
    library filename or 'none' [libpng.a]  ==> /nfs/bio/local.AIX/53/lib/libpng.a
    PNG header directory [default]         ==> /nfs/bio/local.AIX/53/include
    library filename or 'none' [libz.a]    ==> /nfs/bio/local.AIX/53/lib/libz.a
    Z header directory [default]           ==> /nfs/bio/local.AIX/53/include
    
    Note that PNG seems to be a troublemaker here. Not all versions of this library work with netpbm, one might have to fall back to an earlier one. Note further that the configure script runs libpng-config, which may be not what you want.
  2. In Makefile.config:
                                            # AIX 6.1, C 9.0; some source uses //, C99 integer types
    CFLAGS=-O2 -qcpluscmt -D_ISOC99_SOURCE -D_LARGE_FILES -D_THREAD_SAFE
                                            # AIX 5.3, C 8.0
    CFLAGS=-O2 -qcpluscmt -D_ISOC99_SOURCE  # some source uses //, C99 integer types
    #LDFLAGS = -L /usr/pubsw/lib            # no flags needed, this lib does not exist
    
                                            # HP-UX 10.20:
    CFLAGS=-O -Ae -D_REENTRANT -D_FILE_OFFSET_BITS=64 +z
    ...                                     # this definition is originally misplaced:
    CC_FOR_BUILD = $(CC) $(CFLAGS)
    
  3.    make clean
       make
       make package pkgdir=/tmp/netpbm-10.26.29/
       installnetpbm                           # just an option, not mandatory  
    

Installation/Configuration

Strangely, the library libnetpbm.a originally lives in a link subdirectory, rather than the normal lib.
Last update: 29-June-2013, M.Kraemer