# Note: depends on unzip
wget -c http://downloads.sourceforge.net/project/freeimage/Source%20Distribution/3.17.0/FreeImage3170.zip
unzip FreeImage3170.zip
cd FreeImage
# Fix incompatibilities with recent C standards
sed -i -e 's/#[A-Z]/ & /g' Source/LibWebP/./src/dsp/dsp.upsampling_mips_dsp_r2.c Source/LibWebP/./src/dsp/dsp.yuv_mips_dsp_r2.c
sed -i -e '/^ /{s/powf64(\([^,]*\),/powf64((float)\1,(float)/;}' Source/LibRawLite/internal/dcraw_common.cpp
make CXX="g++ -Wno-narrowing" # Doesn't mind -j#
make install