###################################################################### # Autoconf initial setup ###################################################################### AC_INIT([FACT++],[1.0],[thomas.bretz@epfl.ch],[FACTpp],[http://hello.example.com/]) AC_PREREQ([2.65]) AC_CONFIG_FILES([Makefile]) # causes x/Makefile.in to be created if x/Makefile.am exists #AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([.macro_dir]) AC_CONFIG_AUX_DIR([.aux_dir]) AC_PROG_CC([colorgcc gcc]) #If output variable CXXFLAGS was not already set, set it to -g -O2 AC_PROG_CXX([colorgcc g++]) LT_INIT([disable-static]) AC_LANG(C++) #AC_PATH_XTRA ###################################################################### # Automake initial setup ###################################################################### AM_INIT_AUTOMAKE([1.11 -Wall subdir-objects std-options no-define color-tests parallel-tests silent-rules]) AM_SILENT_RULES([yes]) AM_PROG_CC_C_O ###################################################################### # DOXYGEN SUPPORT ###################################################################### ### FIXME: Need a configure commandline switch DX_ENV_APPEND(EXTRACT_ALL, YES) DX_ENV_APPEND(RECURSIVE, YES) DX_ENV_APPEND(ALL_GRAPHS, NO) # change to yes to switch on call(er) graphs #DX_DOXYGEN_FEATURE(ON) #DX_DOT_FEATURE(ON) # sets HAVE_DOT #DX_HTML_FEATURE(ON) # sets GENERATE_HTML (default) #DX_CHM_FEATURE(ON|OFF) # sets GENERATE_HTMLHELP #DX_CHI_FEATURE(ON|OFF) # sets GENERATE_CHI #DX_MAN_FEATURE(ON) # sets GENERATE_MAN (segfaults) #DX_RTF_FEATURE(ON|OFF) # sets GENERATE_RTF #DX_XML_FEATURE(ON|OFF) # sets GENERATE_XML #DX_PDF_FEATURE(ON|OFF) # sets GENERATE_PDF (default) DX_PS_FEATURE(OFF) # sets GENERATE_PS (default) DX_INIT_DOXYGEN($PACKAGE_NAME)#, DOXYFILE-PATH, [OUTPUT-DIR]) #USE_HTAGS = $(USE_HTAGS) ###################################################################### # pthread/Readline/NCurses (pthread needed by dim and boost) ###################################################################### AC_LANG_PUSH(C) # Needed to compile dim ACX_PTHREAD CPPFLAGS+=" "$PTHREAD_CFLAGS" " LDFLAGS+=" "$PTHREAD_CFLAGS" " # Needed to compile FACT++ AC_CHECK_READLINE CPPFLAGS+=" "$READLINE_INCLUDES" " LDFLAGS+=" "$READLINE_LIBS" " #AC_CHECK_LIB(readline, readline, [], # [ # echo "Error! libreadline not found in default libarary paths." # exit -1 # ] #) #AC_CHECK_HEADERS(readline/readline.h, [], # [ # echo "Error! readline/readline.h not properly installed in default include path (maybe readline-dev missing)." # exit -1 # ] #) # # Needed to compile FACT++ AC_CHECK_HEADERS([panel.h],, AC_MSG_ERROR([ncurses header not found])) # Needed to compile FACT++ AC_CHECK_LIB(panel, update_panels,, AC_MSG_ERROR([ncurses panel library not found])) # Needed to compile FACT++ AC_CHECK_PACKAGE(cfitsio, ffpss, cfitsio, fitsio.h,, AC_MSG_ERROR([cfitsio not properly installed/not found.])) #AC_CHECK_HEADERS([fitsio.h],,AC_MSG_ERROR([cfitsio headers not found])) #AC_CHECK_LIB([cfitsio], main,,AC_MSG_ERROR([cfitsio library not found])) AC_LANG_POP # Needed to compile FACT++ AC_CHECK_PACKAGE(ccfits, main, CCfits, CCfits/CCfits,, AC_MSG_ERROR([CCfits not properly installed/not found.])) #AC_CHECK_HEADERS([CCfits/CCfits],, # AC_MSG_ERROR(CCfits headers not found)) #AC_CHECK_LIB(CCfits, main,, # AC_MSG_ERROR(CCfits library not found)) ###################################################################### # Xm.h (lesstif/motif, needed by did) ###################################################################### # Needed to compile dim AC_FIND_MOTIF CPPFLAGS+=" "$MOTIF_INCL" " LDFLAGS+=" "$MOTIF_LDFLAGS" " #AC_CHECK_HEADERS([Mrm/MrmAppl.h], [], # [ # echo "Error! Mrm/MrmAppl.h not properly installed, needed to compile did (you need most probably lesstif2-dev)." # exit -1 # ] #) ###################################################################### # MySQL(++) SUPPORT ###################################################################### # Needed to compile FACT++ MYSQL_DEVEL MYSQLPP_DEVEL LDFLAGS+=" -lmysqlpp " ###################################################################### # BOOST SUPPORT ###################################################################### # Needed to compile FACT++ AX_BOOST_BASE([1.40], [], [ echo "Error! The boost C++ libraries are not properly installed." exit -1 ] ) AX_BOOST_ASIO AX_BOOST_DATE_TIME AX_BOOST_FILESYSTEM AX_BOOST_PROGRAM_OPTIONS AX_BOOST_REGEX AX_BOOST_SYSTEM AX_BOOST_THREAD #AX_BOOST_IOSTREAMS #AX_BOOST_PYTHON #AX_BOOST_SERIALIZATION #AX_BOOST_SIGNALS #AX_BOOST_TEST_EXEC_MONITOR #AX_BOOST_UNIT_TEST_FRAMEWORK #AX_BOOST_WAVE #AX_BOOST_WSERIALIZATION LDFLAGS+=" -lboost_date_time" LDFLAGS+=" -lboost_filesystem" LDFLAGS+=" -lboost_program_options" LDFLAGS+=" -lboost_regex" LDFLAGS+=" -lboost_system" LDFLAGS+=" -lboost_thread " #AC_CHECK_HEADERS( # [\ # boost/bind.hpp \ # boost/lexical_cast.hpp \ # boost/filesystem.hpp \ # boost/thread.hpp \ # boost/function.hpp \ # boost/regex.hpp \ # boost/asio.hpp \ # boost/enable_shared_from_this.hpp \ # boost/asio/deadline_timer.hpp \ # boost/date_time/posix_time/posix_time.hpp \ # boost/date_time/local_time/local_time.hpp \ # boost/date_time/gregorian/gregorian.hpp # ], [], # [ # echo "Error! At least one needed header of the boost C++ libararies is missing." # exit -1 # ] #) ###################################################################### # ROOT SUPPORT ###################################################################### # ROOT_PATH([5.12/00, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]]) # ROOT_PATH([5.12/00]) # ROOT_PATH(3.03/05, , AC_MSG_ERROR(Your ROOT version is too old)) # ROOT_PATH(, AC_DEFINE([HAVE_ROOT])) # ROOTCONF full path to root-config # ROOTEXEC full path to root # ROOTCINT full path to rootcint # ROOTLIBDIR Where the ROOT libraries are # ROOTINCDIR Where the ROOT headers are # ROOTETCDIR Where the ROOT configuration is # ROOTCFLAGS Extra compiler flags # ROOTLIBS ROOT basic libraries # ROOTGLIBS ROOT basic + GUI libraries # ROOTAUXLIBS Auxilary libraries and linker flags for ROOT # ROOTAUXCFLAGS Auxilary compiler flags # ROOTRPATH Same as ROOTLIBDIR ###################################################################### # Check if we have colordiff to colorize 'svn diff' ###################################################################### # Nice to have to support colored diff AC_CHECK_PROG(COLORDIFF, colordiff, colordiff, cat) AC_CHECK_PROG(GROFF, groff, yes, no) AC_CHECK_PROG(PS2PDF, ps2pdf, yes, no) AC_CHECK_PROG(HELP2MAN, help2man, yes, no) ########################################################################## # debug compilation support ########################################################################## # #AC_MSG_CHECKING([whether to build with debug information]) #AC_ARG_ENABLE([debug], # [AS_HELP_STRING([--enable-debug], # [enable debug data generation (def=no)])], # [debugit="$enableval"], # [debugit=no]) #AC_MSG_RESULT([$debugit]) # #if test x"$debugit" = x"yes"; then # AC_DEFINE([DEBUG],[],[Debug Mode]) # AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -Werror -Wno-uninitialized -O0" #else # AC_DEFINE([NDEBUG],[],[No-debug Mode]) # AM_CXXFLAGS="$AM_CXXFLAGS -O3" #fi # ########################################################################## # produce conditionals for Makefile.am and for summary ########################################################################## AM_CONDITIONAL(HAS_COLORDIFF, [test "$COLORDIFF" = colordiff]) AM_CONDITIONAL(HAS_GROFF, [test "$GROFF" = yes]) AM_CONDITIONAL(HAS_PS2PDF, [test "$PS2PDF" = yes]) AM_CONDITIONAL(HAS_HELP2MAN, [test "$HELP2MAN" = yes]) AM_CONDITIONAL(HAS_DOXYGEN, [test -n "$DX_DOXYGEN"]) AM_CONDITIONAL(HAS_DOT, [test -n "$DX_DOT"]) AM_CONDITIONAL(HAS_COLORGCC, [test "$GCC" = colorgcc]) ########################################################################## # print summary ########################################################################## AC_OUTPUT AC_MSG_NOTICE() AC_MSG_NOTICE(============================== summary =============================) AC_MSG_NOTICE() AM_COND_IF(HAS_COLORDIFF, AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: yes]), AC_MSG_NOTICE([ colored svn diff / 'colordiff' found: no]) ) AM_COND_IF(HAS_HELP2MAN,[ AC_MSG_NOTICE([ man-pages enabled / 'help2man' found: $HELP2MAN]) AM_COND_IF(HAS_GROFF, AC_MSG_NOTICE([ build of html enabled / 'groff' found: yes]) AC_MSG_NOTICE([ build of pdf enabled / 'ps2pdf' found: $PS2PDF]), AC_MSG_NOTICE([ build of html and pdf / 'groff' found: no]) ) ],[ AC_MSG_NOTICE([ man, html, pdf enabled / 'help2man' found: no]) ]) AM_COND_IF(HAS_DOXYGEN, AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: $DX_DOXYGEN]), AC_MSG_NOTICE([ doxygen docu enabled / 'doxygen' found: no]) ) AM_COND_IF(HAS_DOT, AC_MSG_NOTICE([ doxygen graphs enabled / 'dot' (graphviz) found: $DX_DOT]), AC_MSG_NOTICE([ doxagen graphs enabled / 'dot' (graphviz) found: no]) ) AC_MSG_NOTICE() AC_MSG_NOTICE(--------------------------------------------------------------------) AC_MSG_NOTICE() AC_MSG_NOTICE([Suggestions and hits:]) AC_MSG_NOTICE() AC_MSG_NOTICE([ - Add 'V=1' to you make-call to switch on verbose output.]) AC_MSG_NOTICE([ - Do not try to create man-pages with doxygen,]) AC_MSG_NOTICE([ it does most probably not work.]) AM_COND_IF(HAS_COLORGCC,, AC_MSG_NOTICE([ - Install colorgcc to get colored compiler output.]) ) AC_MSG_NOTICE() AC_MSG_NOTICE(--------------------------------------------------------------------) AC_MSG_NOTICE() AC_MSG_NOTICE([Some interesting build targets:]) AC_MSG_NOTICE() AC_MSG_NOTICE([ diff: colored 'svn diff' if colordiff is installed]) AM_COND_IF(HAS_HELP2MAN,[ AC_MSG_NOTICE([ program.man: build man-page from 'program --help']) AC_MSG_NOTICE([ (display with 'man ./program.man')]) AM_COND_IF(HAS_GROFF,[ AC_MSG_NOTICE([ program.html: build html page from man-page]) AM_COND_IF(HAS_PS2PDF, AC_MSG_NOTICE([ program.pdf: build pdf documentation from man page]) ) ]) ]) AM_COND_IF(HAS_DOXYGEN, AC_MSG_NOTICE([ doxygen-run: build html documentation with doxygen]) AC_MSG_NOTICE([ doxygen-doc: build html and pdf documentation with doxygen]) ) AC_MSG_NOTICE([ man: build all buildable documentation]) AC_MSG_NOTICE()