]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/tools-src/makeSystem
3 # makeSystem creates a target SYSTEM.def using the appropriate dialect template.
5 # Copyright (C) 2008-2024 Free Software Foundation, Inc.
6 # Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
8 # This file is part of GNU Modula-2.
10 # GNU Modula-2 is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU General Public License as published by the Free
12 # Software Foundation; either version 3, or (at your option) any later
15 # GNU Modula-2 is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 # You should have received a copy of the GNU General Public License along
21 # with gm2; see the file COPYING. If not, write to the Free Software
22 # Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *)
26 echo "Usage: makesystem dialectflag SYSTEM.def SYSTEM.mod { librarypath } compiler"
29 if [ $# -lt 6 ] ; then
39 while [ $# -gt 2 ] ; do
40 if [ "$LIBRARY" = "" ] ; then
43 LIBRARY
="${LIBRARY} $1"
50 if [ "$COMPILER" = "" ] ; then
51 echo "parameter 5 of makeSystem is incorrect, GM2_FOR_TARGET was unset"
55 if [ "$DIALECT" != "-fiso" -a "$DIALECT" != "-fpim" ] ; then
57 echo "dialect must be -fiso or -fpim"
61 displayExportedTypes
() {
64 for i
in ${types} ; do
65 if [ $n -eq 1 ] ; then
67 echo -n " " >> ${OUTPUTFILE}
69 echo -n "$i, " >> ${OUTPUTFILE}
70 if [ $c -eq 4 ] ; then
71 echo " " >> ${OUTPUTFILE}
77 echo " " >> ${OUTPUTFILE}
80 displayBuiltinTypes
() {
81 for i
in ${types} ; do
82 echo " $i ; " >> ${OUTPUTFILE}
87 sed -e "1,/@SYSTEM_DATATYPES@/!d" < ${SYSTEMDEF} | \
88 sed -e "/@SYSTEM_DATATYPES@/d" >> ${OUTPUTFILE}
92 sed -e "1,/@SYSTEM_DATATYPES@/d" < ${SYSTEMDEF} | \
93 sed -e "1,/@SYSTEM_TYPES@/!d" | \
94 sed -e "/@SYSTEM_TYPES@/d" >> ${OUTPUTFILE}
98 sed -e "1,/@SYSTEM_TYPES@/d" < ${SYSTEMDEF} >> ${OUTPUTFILE}
101 MINIMAL
="-fno-scaffold-main -fno-scaffold-dynamic -fno-scaffold-static -fno-m2-plugin"
104 if ${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} \
105 -S -fdump-system-exports ${SYSTEMMOD} -o /dev
/null
2>&1 > /dev
/null
; then
106 types
=`${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} -fno-m2-plugin -S -fdump-system-exports ${SYSTEMMOD} -o /dev/null | cut -f5 -d' '`
114 ${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} \
115 -S -fdump-system-exports ${SYSTEMMOD} -o /dev
/null