If building a shared object, you should use -fPIC to produce position independent code.
If you downloadftp://ftp.debian.org/debian/pool/main/i/ijs/ijs_0.34-1.diff.gz and apply this to the unpacked ijs 0.34 tarball
gunzip -cd ijs_0.34-1.diff.gz | patch -p1
then libtool will be used to compile and link the library. This should know the correct compiler and linker flags.
The IjsPageHeader contains the width and height of the page. The page size can change from page to page when set by setpagedevice. I think resolution is also allowed to change. Some other items like bps (bits per sample) and n_chan (number of channels) are not allowed to change (at least not in Ghostscript which prevents BitsPerPixel from changing after the device is open).
Actually, this isn't true; the CUPS driver for Ghostscript can change BitsPerPixel (actually for the CUPS driver it's cupsBitsPerColor that changes) on-the-fly; it is only gdevprn.c that doesn't check for a change in image depth.