@@ -78,7 +78,7 @@ BINDIR='./bin/' # build directory for unit tests
7878LIBDIR=' ./lib/' # build directory for library
7979MODCODE=' json_module.F90' # json module file name
8080LIBOUT=' libjsonfortran.a' # name of json library
81-
81+ FPP= " gfortran -E " # default to gfortran -E pre-processing
8282
8383# The following warning might be triggered by ifort unless explicitly silenced:
8484# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure name. (R1214.4).
@@ -122,18 +122,21 @@ while [ "$#" -ge "1" ]; do # Get command line arguments while there are more lef
122122 intel|Intel|INTEL|ifort)
123123 FCOMPILER=' Intel'
124124 FCOMPILERFLAGS=" $INTELCOMPILERFLAGS "
125+ FPP=" fpp"
125126 shift
126127 ;;
127128 gnu|Gnu|GNU|gfortran|Gfortran|GFortran|GFORTRAN)
128129 FCOMPILER=' gnu'
129130 FCOMPILERFLAGS=" $GNUCOMPILERFLAGS "
131+ FPP=" gfortran -E"
130132 shift
131133 ;;
132134 * )
133135 FCOMPILER=" custom"
134136 echo " Warning: Trying to build with unsupported compiler, $2 ." 1>&2
135137 echo " Please ensure you set appropriate --cflags and (single) quote them" 1>&2
136138 FC=" $2 "
139+ FPP=" gfortran -E" # try gfortran to preprocess as a default
137140 shift
138141 ;;
139142 esac
@@ -344,6 +347,7 @@ if [[ $JF_SKIP_DOCS != [yY]* ]]; then
344347 if hash ford 2> /dev/null; then
345348 echo " Building documentation..."
346349 [[ $TRY_UNICODE = [yY]* ]] && MACRO_FLAG=(" -m" " USE_UCS4" )
350+ echo " $FPP " > preprocessor-def.md # Override via include in project file, until FORD gets CLI for this
347351 ford --debug " ${MACRO_FLAG[@]} " -p " $PAGESDIR " " $FORDMD "
348352 else
349353 echo " FORD not found! Install using: sudo pip install ford"
0 commit comments