#257 Can't install as non-root because of file ownership issues
Hello,
When installing as non root, such as:
mkdir export
make DESTDIR=$PWD/export install
I get the following:
make -f Makefile.gnu install
make[1]: Entering directory '/tmp/FreeImage'
install -d /tmp/FreeImage/export/usr/include /tmp/FreeImage/export/usr/lib
install -m 644 -o root -g root Source/FreeImage.h /tmp/FreeImage/export/usr/include
install: cannot change ownership of '/tmp/FreeImage/export/usr/include/FreeImage.h': Operation not permitted
Makefile.gnu:73: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/tmp/FreeImage'
Makefile:30: recipe for target 'install' failed
make: *** [install] Error 2
This prevents for installing as non-root, which is useful e.g. when cross-compiling.
I would suggest simply removing the "-o root -g root" arguments (see attached patch), to the install statement. That way we rely on the current user/umask, which should be correct in most cases.
Does it make sense ?