AC_INIT(src/main.cpp) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(FreeMat, 3.5) AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB AC_PROG_LN_S AC_EXEEXT dnl Check for AWT related Qt4 HAVE_QT4="no" dnl There are three configurations we really need to dnl worry about. dnl dnl 1. Linux build - use package config to setup Qt dnl 2. Mingw-cross - specify $QT4DIR dnl 3. Mac build - standard locations for files dnl AC_ARG_WITH([qt4dir], [AC_HELP_STRING([--with-qt4dir=DIR], [Qt4 installation directory used for Win32 builds. For other systems use pkg-config.])], [QT4DIR=$withval] ) is_mac="no" case "$host_os" in darwin*) is_mac="yes";; esac if (test "$cross_compiling" = "no") && (test "$is_mac" = "no"); then AC_MSG_NOTICE([Configuring for non-cross unix build]) PKG_CHECK_MODULES(QT, QtCore QtGui QtOpenGL QtNetwork QtXml >= 4.2.0, HAVE_QT4="yes", HAVE_QT4="no") AC_PATH_XTRA if test "x$HAVE_QT4" = "xyes"; then dnl Check needed because in some cases the QtGui includedir dnl doesn't contain the subsystem dir. QT_INCLUDE_DIR=$($PKG_CONFIG --variable=includedir QtGui) EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt" AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget], AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]), AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget], QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR", AC_MSG_WARN([QWidget not found]))) AC_CHECK_PROGS(QT_MOC, [moc4 moc-qt4 moc], []) AC_CHECK_PROGS(QT_RCC, [rcc4 rcc-qt4 rcc], []) AC_CHECK_PROGS(QT_UIC, [uic4 uic-qt4 uic], []) if (test "$QT_MOC" = ""); then AC_MSG_ERROR([QT4 moc is required.]) fi if (test "$QT_RCC" = ""); then AC_MSG_ERROR([QT4 rcc is required.]) fi if (test "$QT_UIC" = ""); then AC_MSG_ERROR([QT4 uic is required.]) fi fi is_win32="false" platform="--linux" MP_WITH_CURSES LIBS="$LIBS $CURSES_LIB $FLIBS $QT_LIBS" fi if (test "$cross_compiling" = "yes"); then AC_MSG_NOTICE([Configuring for mingw32-cross build]) AC_MSG_NOTICE([Setting up for Qt cross-compile... must have moc, rcc, and uic tools on the path, qt4dir points to cross build]) AC_CHECK_PROGS(QT_MOC, [moc4 moc-qt4 moc], []) AC_CHECK_PROGS(QT_RCC, [rcc4 rcc-qt4 rcc], []) AC_CHECK_PROGS(QT_UIC, [uic4 uic-qt4 uic], []) if (test "$QT_MOC" = ""); then AC_MSG_ERROR([QT4 moc is required.]) fi if (test "$QT_RCC" = ""); then AC_MSG_ERROR([QT4 rcc is required.]) fi if (test "$QT_UIC" = ""); then AC_MSG_ERROR([QT4 uic is required.]) fi QT_CFLAGS="-I$QT4DIR/include -I$QT4DIR/include/QtCore -I$QT4DIR/include/QtGui -I$QT4DIR/include/QtNetwork -I$QT4DIR/include/QtXml -I$QT4DIR/include/QtOpenGL" LIBS="-L$QT4DIR/lib -lQtGui4 -lQtCore4 -lQtNetwork4 -lQtXml4 -lQtOpenGL4 -lopengl32 -lglu32 -lgdi32 -luser32 -lqtmain -lwsock32 -lwinmm $LIBS " LDFLAGS="$LDFLAGS -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-subsystem,windows" platform="--xwin" AC_SUBST(QT4DIR) is_win32="true" AC_CHECK_PROG(WINDRES, [windres], [windres], []) fi if (test "$cross_compiling" = "no") && (test "$is_mac" = "yes"); then AC_MSG_NOTICE([Configuring for Mac OS X build]) platform="--mac" QT_CFLAGS=" -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_SHARED -I$prefix/include -I$prefix/include/QtCore -I$prefix/include/QtGui -I$prefix/include/QtOpenGL -I$prefix/include/QtGui -I$prefix/include/QtNetwork -I$prefix/include/QtXml" LIBS="-L$prefix/lib -F$prefix/lib -F/Library/Frameworks -L/Library/Frameworks -framework QtOpenGL -framework QtGui -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -framework QuickTime -framework AppKit -framework QtCore -framework QtNetwork -framework QtXml -lz -lm -liconv -framework ApplicationServices -framework OpenGL -framework AGL $LIBS" AC_CHECK_PROGS(QT_MOC, [moc4 moc-qt4 moc], []) AC_CHECK_PROGS(QT_RCC, [rcc4 rcc-qt4 rcc], []) AC_CHECK_PROGS(QT_UIC, [uic4 uic-qt4 uic], []) if (test "$QT_MOC" = ""); then AC_MSG_ERROR([QT4 moc is required.]) fi if (test "$QT_RCC" = ""); then AC_MSG_ERROR([QT4 rcc is required.]) fi if (test "$QT_UIC" = ""); then AC_MSG_ERROR([QT4 uic is required.]) fi is_win32="false" fi AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS]) AC_MSG_NOTICE([Win32 flag is $is_win32]) AM_CONDITIONAL(WIN32, test x"$is_win32" = x"true") AC_SUBST(QT_CFLAGS) dnl AC_SUBST(QT_LIBS) AC_SUBST(QT_MOC) AC_SUBST(QT_RCC) AC_SUBST(QT_UIC) AC_SUBST(platform) AC_PROG_F77 AC_F77_LIBRARY_LDFLAGS if test x"${QT_CFLAGS}" = x; then echo "" AC_MSG_ERROR([Qt4 is required. If you have Qt installed see --help for more options]) echo "" fi cdir=`pwd` dnl Check external dependencies dnl Fail? dnl If any are missing, check for CURL dnl If no CURL - quit dnl If no TAR - quit dnl If no GUNZIP - quit dnl If no ZIP - quit dnl Write the external build script dnl Try to run the external build script dnl Recheck external dependencies dnl Fail? --> abort ac_save_libs=$LIBS AC_LIB_FREEMAT_CHECK dnl print a dependency summary... echo \ "******************************************************************** Dependancy summary: Required Libraries - These libraries are critical to the operation of FreeMat. If any of these libraries are not found, FreeMat will not compile. Library Function Status " if (test x"$found_blas" == xyes); then echo \ " BLAS Matrix and vector operations Found" else echo \ " BLAS Matrix and vector operations Not Found" fi if (test x"$found_lapack" == xyes); then echo \ " LAPACK Solving linear systems Found" else echo \ " LAPACK Solving linear systems Not Found" fi if (test x"$found_z" == xyes); then echo \ " libz MAT File I/O Found" else echo \ " libz MAT File I/O Not Found" fi echo \ " Optional Libraries - These libraries are used to provide functionality that is not critical to the operation of FreeMat. If any of these libraries are not found, FreeMat will still compile, but the corresponding functionality will not be available in the resulting binary. Library Function Status " if (test x"$found_fftw3f" == xyes); then echo \ " FFTWF FFT (single precision) Found" else echo \ " FFTWF FFT (single precision) Not Found" fi if (test x"$found_fftw3" == xyes); then echo \ " FFTW FFT (double precision) Found" else echo \ " FFTW FFT (double precision) Not Found" fi if (test x"$found_arpack" == xyes); then echo \ " ARPACK Eigenvalues for Sparse Matrices Found" else echo \ " ARPACK Eigenvalues for Sparse Matrices Not Found" fi if (test x"$found_umfpack" == xyes) && (test x"$found_amd" == xyes) && (test x"$found_umfpackh" == xyes) && (test x"$found_amdh" == xyes); then echo \ " UMFPACK Solutions of Sparse Linear Equations Found" else echo \ " UMFPACK Solutions of Sparse Linear Equations Not Found" fi if (test x"$found_avcall" == xyes); then echo \ " AVCALL Imported functions Found" else echo \ " AVCALL Imported functions Not Found" fi if (test x"$found_pcre" == xyes); then echo \ " PCRE Regular Expressions Found" else echo \ " PCRE Regular Expressions Not Found" fi if (test x"$found_portaudio" == xyes); then echo \ " PORTAUDIO Audio I/O Found" else echo \ " PORTAUDIO Audio I/O Not Found" fi if (test x"$found_cycle" == xyes); then echo \ " CYCLE COUNTER Profiling Functions Found" else echo \ " CYCLE COUNTER Profiling Functions Not Found" fi echo \ "********************************************************************" if (test x"$found_blas" == xno) || (test x"$found_lapack" == xno) || (test x"$found_z" == xno); then AC_MSG_ERROR([ One or more of the required external dependencies was not found. Please install the missing dependencies (as listed above) and rerun configure.]) fi AC_ARG_WITH([llvm], [AC_HELP_STRING([--with-llvm], [support Just In Time compiler (requires llvm > 2.0)])], use_llvm="yes", use_llvm="no") if (test "$use_llvm" = "yes"); then AC_PATH_PROG(LLVM_CONFIG, llvm-config, no) if test "$LLVM_CONFIG" = "no" ; then AC_MSG_NOTICE([Unable to find llvm-config. JIT support disabled.]) else CXXFLAGS="`$LLVM_CONFIG --cxxflags` $CXXFLAGS" LIBS="`$LLVM_CONFIG --libs jit engine interpreter` $LIBS"; LDFLAGS="`$LLVM_CONFIG --ldflags` $LDFLAGS"; fi AC_DEFINE(HAVE_LLVM, 1, [Set to 1 if you have LLVM installed]) fi AM_CONDITIONAL(USECLI, test x$ismingw = xfalse) AC_OUTPUT([Makefile src/Makefile libs/Makefile libs/libFreeMat/Makefile libs/libCore/Makefile libs/libFN/Makefile libs/libMex/Makefile libs/libXP/Makefile libs/libGraphics/Makefile images/Makefile tools/Makefile])