To build Ghostscript as a shared object with gcc (instead of as a single large executable) use: # rm -rf expat freetype jpeg lcms2 libpng tiff jasper lcms zlib # export CFLAGS="-Os -Wl,--as-needed" # ./configure --prefix=/usr --enable-dynamic --with-system-libtiff LIBS=-lz --libdir=/usr/lib64 --disable-gtk --with-x=no --without-x --with-fontpath=/usr/share/fonts/default/TTF --enable-dynamic --disable-cairo --disable-compile-inits --without-jasper # make so #No parallel builds, may break build # new2dir make soinstall