gcc -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long int" -O2 -march=x86-64 -pipe -fPIC -DUSE_LIBPAPER -I./base -o ./obj/genarch ./base/genarch.c ./obj/genarch ./obj/arch.h gcc -DHAVE_MKSTEMP -DHAVE_HYPOT -DHAVE_FILE64 -DHAVE_MKSTEMP64 -DHAVE_FONTCONFIG -O2 -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long int" -O2 -march=x86-64 -pipe -fPIC -DUSE_LIBPAPER -I./obj -I./base -o ./obj/gp_getnv.o -c ./base/gp_getnv.c gcc -DHAVE_MKSTEMP -DHAVE_HYPOT -DHAVE_FILE64 -DHAVE_MKSTEMP64 -DHAVE_FONTCONFIG -O2 -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long int" -O2 -march=x86-64 -pipe -fPIC -DUSE_LIBPAPER -I./obj -I./base -o ./obj/gp_upapr.o -c ./base/gp_upapr.c ./base/gp_upapr.c:18:19: error: paper.h: No such file or directory ./base/gp_upapr.c: In function 'gp_defaultpapersize': ./base/gp_upapr.c:32: warning: implicit declaration of function 'systempapername' ./base/gp_upapr.c:32: warning: initialization makes pointer from integer without a cast make: *** [obj/gp_upapr.o] Error 1 Creating /var/log/lunar/compile/ghostscript-8.64.bz2 The problem when using --with-libpaper, configure looks for paper.h in /usr/inclue/paper. However, libpaper installs the header in /usr/include/libpaper. I changed the -lpaper to -llibpaper in configure to solve this and the configure/make/make install went fine.
What distribution and source package are you using? Upstream ghostscript doesn't check for paper.h at all, I just assumes it's on the default search path: /usr/include/paper.h in the case of my ubuntu system. Or put another way, I don't understand how changing the name of the library helped it find the header. :)
Using Linux-Linux distro ( http://www.lunar-linux.org/index.php ). Ghostscript does check for libpaper as noted by; checking for systempapername in -lpaper... no which you can confirm from the ghostscript tarball, and running ./configure --help, which will show you a --with-libpaper. So yes, upstream ghostscript does check for it's presence. What hacks Ubuntu uses, I don't know, don't use that distro. In the example above, I did not have libpaper installed so it says no. If libpaper is not installed, the build process moves along just fine without issue. Also, if libpaper is installed, the file base/gp_upapr.c contains; #ifdef USE_LIBPAPER #include <paper.h> which is not the default include path libpaper throws paper.h. libpaper when compiled from source, and no distro specific hackery is used, just prefix=/usr. It will throw paper.h in /usr/include/libpaper/ . Anyway, your right, it did not help it find the header. This was just a dirty hack by me to get ghostscript to compile with the presence of libpaper, without first uninstalling it. It still does not alter the issue that ghostscript looks for paper.h in the wrong include path as specified by the default (--prefix=/usr) include path used by libpaper.
Addendum: Just to clarify the header location for paper.h. I was wrong about the default header location for paper.h. Had forgotten Lunar uses --includedir=/usr/include/libpaper during the build process of libpaper, because gcc 4.2.2 also provides paper.h. Thus one application over writes a header from another. Not really good form.
(In reply to comment #3) > Addendum: > > Just to clarify the header location for paper.h. I was wrong about the default > header location for paper.h. Had forgotten Lunar uses > --includedir=/usr/include/libpaper during the build process of libpaper, because > gcc 4.2.2 also provides paper.h. Thus one application over writes a header from > another. Not really good form. Since it works on Ubuntu (Ralph's), and I just tried it on Fedora, and it works here --with-libpaper also without modification (and ./obj/gp_upapr.o is compiled with -DUSE_LIBPAPER). I am resolving this as WORKSFOME. Suggest the reporter contact Lunar Linux for this issue: gcc should not ship/install paper.h.