33# Usage info
44usage ()
55{
6- echo " Usage:list_unsupported.sh [--help] [--apex] path_to_ada_source_folder"
6+ echo " Usage:list_unsupported.sh [--help] [--apex] [--adc pragmas.adc] path_to_ada_source_folder"
77 echo
88 echo " Run GNAT2Goto on an Ada repository."
99 echo
1010 echo " The output is an ordered list of currently unsupported features"
1111 echo " with the number of times they occur in the input repository."
1212 echo
1313 echo " Options:"
14- echo " --help Display this usage information"
15- echo " --apex Use Rational APEX style naming convention .1.ada and .2.ada"
14+ echo " --help Display this usage information"
15+ echo " --apex Use Rational APEX style naming convention .1.ada and .2.ada"
16+ echo " --adc pragmas.adc Use the specified 'pragmas.adc' file during compilation"
1617}
1718
1819# File extensions to expect for Specification files and Body files
@@ -111,6 +112,17 @@ while [ -n "$1" ] ; do
111112 --apex)
112113 spec_ext=" 1.ada"
113114 body_ext=" 2.ada"
115+ pragma_file=" $( dirname ${0} ) /rational-apex.adc"
116+ ;;
117+ --adc)
118+ shift
119+ if [ -r " ${1} " ] ; then
120+ pragma_file=" ${1} "
121+ else
122+ usage >&2
123+ echo >&2 " --adc option must specify a configuration pragma file"
124+ exit 2
125+ fi
114126 ;;
115127 --help)
116128 usage
@@ -162,6 +174,10 @@ for include_folder in `echo "$ADA_INCLUDE_PATH" | tr ':' ' '` ; do
162174 done
163175done
164176
177+ if [ -n " ${pragma_file} " ]; then
178+ pragma_file_opt=" -gnatec=${pragma_file} "
179+ fi
180+
165181# Before attempting to start compiling, make a clear log of the environment
166182# we will be using:
167183echo >&2 " -------------------------------------------------------"
@@ -179,7 +195,7 @@ compile_error_occured=0
179195for filename in $( find ${path} -name " *.${body_ext} " | LC_ALL=posix sort) ; do
180196 printf " Compiling %s..." " ${filename} " >&2
181197 echo " ---------- COMPILING: $filename " >> " $file_name " .txt
182- " ${GNAT2GOTO} " -gnatU ${include_path} " ${filename} " > " $file_name " .txt.compiling 2>&1
198+ " ${GNAT2GOTO} " ${pragma_file_opt} -gnatU ${include_path} " ${filename} " > " $file_name " .txt.compiling 2>&1
183199 result=$?
184200 cat " $file_name " .txt.compiling >> " $file_name " .txt
185201
0 commit comments