@@ -25,20 +25,22 @@ PROJECTNAME='jsonfortran' # project name for robodoc (example: jsonfortran
2525DOCDIR=' ./documentation/' # build directory for documentation
2626SRCDIR=' ./src/' # library source directory
2727TESTDIR=' ./src/tests/' # unit test source directory
28+ INTROSPECDIR=' ./src/tests/introspection/' # pre compile configuration tests directory
29+ UCS4TESTCODE=' test_iso_10646_support.f90'
2830BINDIR=' ./bin/' # build directory for unit tests
2931LIBDIR=' ./lib/' # build directory for library
30- MODCODE=' json_module.f90 ' # json module file name
32+ MODCODE=' json_module.F90 ' # json module file name
3133LIBOUT=' libjsonfortran.a' # name of json library
3234
3335
3436# The following warning might be triggered by ifort unless explicitly silenced:
3537# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure name. (R1214.4).
3638# In the context of F2008 this is an erroneous warning.
3739# See https://prd1idz.cps.intel.com/en-us/forums/topic/486629
38- INTELCOMPILERFLAGS=' -c -O2 -warn -stand f08 -diag-disable 7601 -traceback'
40+ INTELCOMPILERFLAGS=' -c -O2 -warn -stand f08 -diag-disable 7601 -diag-disable 4013 - traceback'
3941# INTELCOMPILERFLAGS='-c -O2 -warn -traceback -stand f08 -assume protect_parens -assume buffered_io -check all'
4042
41- GNUCOMPILERFLAGS=' -c -O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -pedantic -std=f2008'
43+ GNUCOMPILERFLAGS=' -c -O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-function - pedantic -std=f2008'
4244
4345FCOMPILER=' gnu' # Set default compiler to gfortran
4446
@@ -55,7 +57,7 @@ print_usage () {
5557 echo -e " \n\nUsage:\n"
5658 echo -e " ${script_name} [--compiler {intel|gnu|<other>}] [--cflags '<custom compiler flags here>']\n\
5759 [--coverage [{yes|no}]] [--profile [{yes|no}]] [--skip-tests [{yes|no}]]\n\
58- [--skip-documentation [{yes|no}]] [--help]"
60+ [--skip-documentation [{yes|no}]] [--enable-unicode [{yes|no}]] [-- help]"
5961 echo " "
6062 echo -e " Any flags that take an optional yes or no argument will default to 'yes' when no\n\
6163argument is passed. Additionally, A custom compiler may be passed to the 'compiler'\n\
@@ -94,6 +96,22 @@ while [ "$#" -ge "1" ]; do # Get command line arguments while there are more lef
9496 # no good way to check that the user didn't do something questionable
9597 shift
9698 ;;
99+ --enable-unicode)
100+ case $2 in
101+ yes|Yes|YES)
102+ TRY_UNICODE=" yes"
103+ shift
104+ ;;
105+ no|No|NO)
106+ TRY_UNICODE=" no"
107+ shift
108+ ;;
109+ * )
110+ TRY_UNICODE=" yes"
111+ # don't shift; $2 is next arg
112+ ;;
113+ esac
114+ ;;
97115 --coverage) # enable coverage
98116 case $2 in
99117 yes|Yes|YES)
@@ -185,17 +203,26 @@ if [[ $CODE_PROFILE == [yY]* ]]; then
185203fi
186204
187205if [[ $FCOMPILER == custom ]]; then
206+ echo " Trying to compile with custom compiler, $FC "
188207 CUSTOM=" -fc $FC "
189208fi
190209
210+ if [[ $TRY_UNICODE == [yY]* ]]; then
211+ echo " Trying to compile library with Unicode/UCS4 support"
212+ FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} " -dbld " ${BINDIR} " -s " ${INTROSPECDIR} " -dmod ./ -dobj ./ -t ${UCS4TESTCODE} -o ${UCS4TESTCODE% .f90} -colors
213+ if " ${BINDIR} /${UCS4TESTCODE% .f90} " ; then
214+ DEFINES=" -DUSE_UCS4 -Wunused-function"
215+ fi
216+ fi
217+
191218# build the stand-alone library:
192219echo " "
193220echo " Building library..."
194221
195222# work around for FoBiS.py PR #45
196223[ -d " $LIBDIR " ] || mkdir " $LIBDIR "
197224
198- FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} " ${COVERAGE} ${PROFILING} -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
225+ FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} ${DEFINES} " ${COVERAGE} ${PROFILING} -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
199226
200227# build the unit tests (uses the above library):
201228if [[ $JF_SKIP_TESTS != [yY]* ]]; then
@@ -205,10 +232,10 @@ if [[ $JF_SKIP_TESTS != [yY]* ]]; then
205232 # FoBiS.py PR #45 work around
206233 [ -d " $BINDIR " ] || mkdir " $BINDIR "
207234
208- for TEST in " ${TESTDIR%/ } " /jf_test_* .f90 ; do
235+ for TEST in " ${TESTDIR%/ } " /jf_test_* .[fF]90 ; do
209236 THIS_TEST=${TEST##*/ }
210- echo " Build ${THIS_TEST% .f90 } "
211- FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} " ${COVERAGE} ${PROFILING} -dbld ${BINDIR} -s ${TESTDIR} -i ${LIBDIR} -libs ${LIBDIR} /${LIBOUT} -dmod ./ -dobj ./ -t ${THIS_TEST} -o ${THIS_TEST% .f90 } -colors
237+ echo " Build ${THIS_TEST% .[fF]90 } "
238+ FoBiS.py build -ch -compiler ${FCOMPILER} ${CUSTOM} -cflags " ${FCOMPILERFLAGS} ${DEFINES} " ${COVERAGE} ${PROFILING} -dbld ${BINDIR} -s ${TESTDIR} -i ${LIBDIR} -libs ${LIBDIR} /${LIBOUT} -dmod ./ -dobj ./ -t ${THIS_TEST} -o ${THIS_TEST% .[fF]90 } -colors
212239 done
213240else
214241 echo " Skip building the unit tests since \$ JF_SKIP_TESTS has been set to 'true'."
0 commit comments