1# -*- Autoconf -*- 2# 3# Configure script for the XMLF90 package 4# 5# Copyright (C) 2017 Y. Pouillon 6# 7# This file is part of the XMLF90 software package. For license information, 8# please see the COPYING file in the top-level directory of the source 9# distribution. 10# 11 12 # ------------------------------------ # 13 14# 15# Autotools startup 16# 17 18# Init Autoconf 19AC_PREREQ(2.69) 20AC_INIT([XMLF90], [1.5.5], 21 [https://bugs.launchpad.net/xmlf90], 22 [xmlf90], 23 [https://launchpad.net/xmlf90]) 24AC_REVISION([Autotools support for XMLF90]) 25AC_CONFIG_AUX_DIR(config/gnu) 26AC_CONFIG_MACRO_DIR([config/m4]) 27AC_CONFIG_SRCDIR(src/sax/m_xml_parser.f90) 28 29# Make relevant path available globally 30_AC_SRCDIRS([.]) 31AC_SUBST(ac_abs_top_srcdir) 32AC_SUBST(ac_abs_top_builddir) 33 34# Init Automake 35AC_CANONICAL_TARGET 36AM_INIT_AUTOMAKE([1.14]) 37 38# Generate timestamp 39x90_timestamp=`date '+%Y%m%dT%H%M%S%z'` 40AC_SUBST(x90_timestamp) 41 42# Export version triplet 43XMLF90_VERSION_MAJOR=`echo "${PACKAGE_VERSION}" | cut -d. -f1` 44XMLF90_VERSION_MINOR=`echo "${PACKAGE_VERSION}" | cut -d. -f2` 45XMLF90_VERSION_MICRO=`echo "${PACKAGE_VERSION}" | cut -d. -f3` 46AC_SUBST(XMLF90_VERSION_MAJOR) 47AC_SUBST(XMLF90_VERSION_MINOR) 48AC_SUBST(XMLF90_VERSION_MICRO) 49 50 # ------------------------------------ # 51 52# 53# Command-line options 54# 55 56# Control the generation of documentation 57AC_ARG_ENABLE([docgen], 58 AC_HELP_STRING([--enable-docgen], 59 [Enable the generation of developer documentation (experimental, disabled by default)]), 60 [ 61 if test "${enableval}" = "no" -o "${enableval}" = "yes"; then 62 x90_docgen_enable="${enableval}" 63 else 64 AC_MSG_ERROR([--enable-docgen must be 'yes' or 'no', not '${enableval}']) 65 fi 66 ], 67 [x90_docgen_enable="no"]) 68AC_SUBST(x90_docgen_enable) 69 70# Allow the user to specify where to find Doxygen 71AC_ARG_VAR([DOXYGEN], [Path to the 'doxygen' command]) 72 73 # ------------------------------------ # 74 75# 76# System utilities 77# 78 79# Check for common programs 80AC_PROG_MAKE_SET 81AC_PROG_INSTALL 82AC_PROG_LN_S 83AC_PROG_SED 84AC_PROG_AWK 85AC_PROG_GREP 86 87 # ------------------------------------ # 88 89# 90# C language support 91# 92 93# Init C compiler and preprocessor 94AC_PROG_CC 95AC_PROG_CPP 96 97# C compiler peculiarities (for Libtool) 98AM_PROG_CC_C_O 99 100 # ------------------------------------ # 101 102# 103# Fortran language support 104# 105 106# Look for the Fortran compiler 107if test "${FC}" != "" -a ! -x "${FC}"; then 108 x90_fc_probe=`echo "${FC}" | sed -e 's/ .*//'` 109 if test ! -x "${x90_fc_probe}"; then 110 AC_PATH_PROG([x90_fc_path],[${x90_fc_probe}]) 111 if test "${x90_fc_path}" = ""; then 112 AC_MSG_ERROR([could not run Fortran compiler "${FC}"]) 113 fi 114 fi 115fi 116AC_PROG_FC 117 118# Fail if no Fortran compiler is available 119if test "${FC}" = ""; then 120 AC_MSG_ERROR([no Fortran compiler available]) 121fi 122 123# Fortran compiler peculiarities 124AX_F90_MODULE_EXTENSION 125AX_F90_MODULE_CASE 126MODEXT="${ax_cv_f90_modext}" 127AC_SUBST(MODEXT) 128 129# Select how to handle Fortran modules 130AM_CONDITIONAL([F90_MOD_UPPERCASE], 131 [test "${ax_cv_f90_mod_uppercase}" = "yes"]) 132 133 # ------------------------------------ # 134 135# 136# Libtool configuration 137# 138 139# Init Libtool (must be done once compilers are fully set) 140LT_INIT 141LT_PREREQ([2.4.2]) 142LT_LANG([Fortran]) 143LTOBJEXT="lo" 144AC_SUBST(LTOBJEXT) 145 146 # ------------------------------------ # 147 148# 149# Documentation generation 150# 151 152# Look for Doxygen 153if test "${x90_docgen_enable}" != "no"; then 154 if test -z "${DOXYGEN}"; then 155 AC_CHECK_PROGS([DOXYGEN], [doxygen]) 156 fi 157fi 158 159# Look for LaTeX 160# 161# Note: These environment variables must be reset because Doxygen uses 162# hard-coded program names. 163# 164MAKEINDEX="" 165PDFLATEX="" 166if test "${x90_docgen_enable}" != "no" -a ! -z "${DOXYGEN}"; then 167 AC_CHECK_PROGS([MAKEINDEX], [makeindex]) 168 AC_CHECK_PROGS([PDFLATEX], [pdflatex]) 169fi 170AC_SUBST(MAKEINDEX) 171AC_SUBST(PDFLATEX) 172 173 # ------------------------------------ # 174 175# 176# Final checks 177# 178 179# Write down YAML configuration now (allows full report with deferred errors) 180AC_OUTPUT([config/data/xmlf90-config.yml]) 181 182# Decide what to do with documentation 183if test "${x90_docgen_enable}" = "yes" -a -z "${DOXYGEN}"; then 184 AC_MSG_FAILURE([Documentation generation was requested from the command line 185 but Doxygen was not found]) 186fi 187if test "${x90_docgen_enable}" = "auto" -a ! -z "${DOXYGEN}"; then 188 x90_docgen_enable="yes" 189fi 190AM_CONDITIONAL([DO_BUILD_DOXYGEN], [test "${x90_docgen_enable}" = "yes"]) 191AM_CONDITIONAL([DO_BUILD_LATEX], [test "${x90_docgen_enable}" = "yes" -a ! -z "${MAKEINDEX}" -a ! -z "${PDFLATEX}"]) 192 193 # ------------------------------------ # 194 195# 196# Output configuration 197# 198 199AC_OUTPUT([ 200 config/data/xmlf90.mk 201 config/data/xmlf90.pc 202 Makefile 203 src/Makefile 204 src/xmlf90_info.f90 205 src/cml/Makefile 206 src/dom/Makefile 207 src/sax/Makefile 208 src/wxml/Makefile 209 src/xpath/Makefile 210 doc/Doxyfile 211 doc/Makefile 212 doc/Examples/Makefile 213 doc/Examples/cml/Makefile 214 doc/Examples/dom/Makefile 215 doc/Examples/sax/Makefile 216 doc/Examples/sax/count/Makefile 217 doc/Examples/sax/features/Makefile 218 doc/Examples/sax/pseudo/Makefile 219 doc/Examples/sax/simple/Makefile 220 doc/Examples/wxml/Makefile 221 doc/Examples/xpath/Makefile 222 doc/Tutorial/Makefile 223 doc/Tutorial/sax/Makefile 224 doc/Tutorial/xpath/Makefile 225]) 226 # ------------------------------------ # 227 228# 229# Report configuration 230# 231 232AC_MSG_NOTICE([ 233 234Final build parameters 235---------------------- 236 237 TSTAMP = ${x90_timestamp} 238 239 docgen = ${x90_docgen_enable} 240 241 CPP = ${CPP} 242 CPPFLAGS = ${CPPFLAGS} 243 CC = ${CC} 244 CFLAGS = ${CFLAGS} 245 FC = ${FC} 246 FCFLAGS = ${FCFLAGS} 247 LDFLAGS = ${LDFLAGS} 248 LIBS = ${LIBS} 249 250 DOXYGEN = ${DOXYGEN} 251 MAKEINDEX = ${MAKEINDEX} 252 PDFLATEX = ${PDFLATEX} 253 254This information is also available in YAML format inside 255config/data/${PACKAGE}-config.yml for future reference. 256 257You can now build ${PACKAGE_STRING} by typing "make", or 258e.g. "make -j8" for a parallel build with 8 processes. 259]) 260