tce-load -i compiletc Xorg-7.7-3d-dev liblzma-dev librsvg-dev libwebp1-dev libtool-dev djvulibre-dev libgs-dev graphviz-dev perl5 libwmf-dev fftw-dev zstd-dev libraw-dev openexr-dev

cd ImageMagick-6.9.10-42

patch -Np1 -i ../ImageMagick-6.9.10-27-libs_only-1.patch
autoreconf -fi

sudo cp /tmp/tcloop/gcc_libs-dev/usr/local/lib/libgomp.spec /usr/lib

CC="gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -mtune=generic -Os -pipe" ./configure -prefix=/usr/local --disable-static --localstatedir=/var --enable-hdri --with-modules --with-rsvg --with-dejavu-font-dir=/usr/local/share/fonts/dejavu --with-gs-font-dir=/usr/local/share/ghostscript/fonts --with-perl=yes --with-gslib=yes

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-mtune=haswell//g' {} \;
find . -name Makefile.PL -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile.PL -type f -exec sed -i 's/-mtune=haswell//g' {} \;

make [4m 29.80s]
sudo make install

==============================================================================
ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

  Host system type: x86_64-pc-linux-gnu
  Build system type: x86_64-pc-linux-gnu

                 Option                        Value
  ------------------------------------------------------------------------------
  Shared libraries  --enable-shared=yes         yes
  Static libraries  --enable-static=no          no
  Module support    --with-modules=yes          yes
  GNU ld            --with-gnu-ld=yes           yes
  Quantum depth     --with-quantum-depth=16     16
  High Dynamic Range Imagery
                    --enable-hdri=yes           yes

  Install documentation:                        yes

  Delegate Library Configuration:
  BZLIB             --with-bzlib=yes            yes
  Autotrace         --with-autotrace=no         no
  DJVU              --with-djvu=yes             yes
  DPS               --with-dps=yes              no
  FFTW              --with-fftw=yes             yes
  FLIF              --with-flif=yes             no
  FlashPIX          --with-fpx=yes              no
  FontConfig        --with-fontconfig=yes       yes
  FreeType          --with-freetype=yes         yes
  Ghostscript lib   --with-gslib=yes            yes
  Graphviz          --with-gvc=yes              yes
  HEIC              --with-heic=yes    no
  JBIG              --with-jbig=yes             no
  JPEG v1           --with-jpeg=yes             yes
  LCMS              --with-lcms=yes             yes
  LQR               --with-lqr=yes              no
  LTDL              --with-ltdl=yes             yes
  LZMA              --with-lzma=yes             yes
  Magick++          --with-magick-plus-plus=yes yes
  OpenEXR           --with-openexr=yes          yes
  OpenJP2           --with-openjp2=yes          yes
  PANGO             --with-pango=yes            yes
  PERL              --with-perl=yes             /usr/local/bin/perl
  PNG               --with-png=yes              yes
  RAQM              --with-raqm=yes             no
  RAW               --with-raw=yes      yes
  RSVG              --with-rsvg=yes             yes
  TIFF              --with-tiff=yes             yes
  WEBP              --with-webp=yes             yes
  WMF               --with-wmf=yes              yes
  X11               --with-x=                   yes
  XML               --with-xml=yes              yes
  ZLIB              --with-zlib=yes             yes
  ZSTD              --with-zstd=yes             yes

  Delegate Program Configuration:
  GhostPCL          None                                pcl6 (unknown)
  GhostXPS          None                                gxps (unknown)
  Ghostscript       None                                gs (9.10)

  Font Configuration:
  Apple fonts       --with-apple-font-dir=default       
  Dejavu fonts      --with-dejavu-font-dir=/usr/local/share/fonts/dejavu        /usr/local/share/fonts/dejavu/
  Ghostscript fonts --with-gs-font-dir=/usr/local/share/ghostscript/fonts       /usr/local/share/ghostscript/fonts/
  URW-base35 fonts  --with-urw-base35-font-dir=default  none
  Windows fonts     --with-windows-font-dir=default     none

  X11 Configuration:
        X_CFLAGS        = 
        X_PRE_LIBS      =  -lSM -lICE
        X_LIBS          = 
        X_EXTRA_LIBS    = 

  Options used to compile and link:
    PREFIX          = /usr/local
    EXEC-PREFIX     = /usr/local
    VERSION         = 6.9.10
    CC              = gcc -flto -fuse-linker-plugin -mtune=generic -Os -pipe
    CFLAGS          = -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/libdrm -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/include/uuid -I/usr/local/include -pthread -I/usr/local/include/librsvg-2.0 -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/libpng16 -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/libdrm -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/include/uuid -I/usr/local/include -I/usr/local/include/libraw -I/usr/local/include -I/usr/local/include/libpng16  -I/usr/local/include/pango-1.0 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/include/pixman-1 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include/libdrm -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/include/uuid -I/usr/local/include -pthread -I/usr/local/include/OpenEXR -I/usr/local/include -I/usr/local/include/openjpeg-2.3 -I/usr/local/include -I/usr/local/include/graphviz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/include/uuid -pthread -I/usr/local/include -I/usr/local/include     -g -O2 -Wall -mtune=haswell -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
    CPPFLAGS        =   -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 
    PCFLAGS         = 
    DEFS            = -DHAVE_CONFIG_H
    LDFLAGS         =  
    LIBS            =  -L/usr/local/lib -llcms2 -L/usr/local/lib -lfreetype   -L/usr/local/lib -lfftw3  -L/usr/local/lib -lxml2 -L/usr/local/lib -lfontconfig -lfreetype -lXext   -lSM -lICE -lX11  -lXt -L/usr/local/lib -llzma -lbz2 -lz  -lltdl   -lm    
    CXX             = g++ -flto -fuse-linker-plugin -mtune=generic -Os -pipe
    CXXFLAGS        = -g -O2 -pthread
    FEATURES        = DPC HDRI Cipher Modules
    DELEGATES       = bzlib djvu mpeg fftw fontconfig freetype gslib jng jpeg lcms lzma openexr openjp2 pango png ps raw rsvg tiff webp wmf x xml zlib zstd
==============================================================================
