#!/bin/bash
#
# Notes:
#
# (1) Use gcc-4.7 to build GraphicsMagick
#
#     sudo port install GraphicsMagick +q32 configure.compiler=macports-gcc-4.7
#
# (2) Edit libgnu/stdio.in.h and remove the lines below.
#
#     /* It is very rare that the developer ever has full control of stdin,
#        so any use of gets warrants an unconditional warning; besides, C11
#        removed it.  */
#     #undef gets
#     #if HAVE_RAW_DECL_GETS
#     _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
#     #endif
#
GCCVER=4.7

./configure                                               \
   CC="ccache gcc-mp-$GCCVER"                             \
   CFLAGS="-pipe -O2 -m64 -g"                             \
   CPPFLAGS="-D_THREAD_SAFE -I/opt/local/include"         \
   LDFLAGS="-L/opt/local/lib -m64 "                       \
   CXX="ccache g++-mp-$GCCVER"                            \
   CXXFLAGS="-pipe -O2 -m64"                              \
   SHLIB_CXXLD="g++-mp-$GCCVER"                           \
   FC="ccache gfortran-mp-$GCCVER"                        \
   F77="ccache gfortran-mp-$GCCVER"                       \
   FFLAGS="-pipe -O2 -m64"                                \
   LLVM_CONFIG=/opt/local/bin/llvm-config-mp-3.4          \
   --disable-jit                                          \
   --with-magick=GraphicsMagick                           \
   --with-lapack="-llapack -latlas -lgfortran"            \
   --with-blas="-lcblas -lf77blas -latlas -lgfortran"     \
   --prefix=/usr/local/octave/4.1.0                       \
   --enable-gui                                           \
   --disable-java                                         \
   --with-framework-carbon                                \
   --with-arpack                                          \
   --enable-docs                                          \
   --with-opengl                                          \
   --without-x                                            \
   --enable-link-all-dependencies

