How to compile FULLY STATIC under LInux?
Posted: 2008-04-28T00:00:01-07:00
Hi,
I need to deploy ImageMagick's "convert" utility on a a shared host, where I don't have access to /usr/lib, env or anything else except the webspace. I can however drop a binary into the webspace, chmod it to 755 and run it (from the Apache context).
So what I did was to install Debian at home (inclunding gcc, and libtiff*-dev, libpng*.dev, jasper*-dev, etc) and compile a static version of ImageMagick (V6.4.0). I used the follging vonfigure command:
The result was (among others) a "convert" binary with (very roughly) 6.5MB size. However, after deployment on the shared host, "convert" complains about a missing "libtiff.so.4" library (I also had to deploy the *.xml files to the web root, of course). A quick check with "ldd" on the development machine revealed indeed that the "static compile" of "convert" still requires shared libraries - none of ImageMagick's shared libraries, just the "standard libraries" like libtiff and libpng.
Just to verify thing I then tries a configure/make/deploy/test cycle with
and everything went fine on the shared host - except, of course, that "convert" was now limited to handle GIFs. Unfortunately, I need it to handle JPEGs and PNGs as well....
My idea is that a fully static compile (or at least a compile where libtiff and libpng and whatever image format handling library is required) might help. Unfortunately, I didn't manage to get this done. Has anyone an idea on how to enlighten the linker to do what I want? Or any other solution, other than switching hosts?
Thanks, and best regards, Klaus
I need to deploy ImageMagick's "convert" utility on a a shared host, where I don't have access to /usr/lib, env or anything else except the webspace. I can however drop a binary into the webspace, chmod it to 755 and run it (from the Apache context).
So what I did was to install Debian at home (inclunding gcc, and libtiff*-dev, libpng*.dev, jasper*-dev, etc) and compile a static version of ImageMagick (V6.4.0). I used the follging vonfigure command:
Code: Select all
./configure --enable-shared
Just to verify thing I then tries a configure/make/deploy/test cycle with
Code: Select all
./configure --enable-shared --without-tiff --without-freetype --without-jpeg --without-jp2 --without-png --without-tiff
My idea is that a fully static compile (or at least a compile where libtiff and libpng and whatever image format handling library is required) might help. Unfortunately, I didn't manage to get this done. Has anyone an idea on how to enlighten the linker to do what I want? Or any other solution, other than switching hosts?
Thanks, and best regards, Klaus