1#!/bin/sh 2############################################################################## 3# Copyright 2018-2020,2022 Thomas E. Dickey # 4# Copyright 2016,2018 Free Software Foundation, Inc. # 5# # 6# Permission is hereby granted, free of charge, to any person obtaining a # 7# copy of this software and associated documentation files (the "Software"), # 8# to deal in the Software without restriction, including without limitation # 9# the rights to use, copy, modify, merge, publish, distribute, distribute # 10# with modifications, sublicense, and/or sell copies of the Software, and to # 11# permit persons to whom the Software is furnished to do so, subject to the # 12# following conditions: # 13# # 14# The above copyright notice and this permission notice shall be included in # 15# all copies or substantial portions of the Software. # 16# # 17# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # 18# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # 19# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # 20# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # 21# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # 22# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # 23# DEALINGS IN THE SOFTWARE. # 24# # 25# Except as contained in this notice, the name(s) of the above copyright # 26# holders shall not be used in advertising or otherwise to promote the sale, # 27# use or other dealings in this Software without prior written # 28# authorization. # 29############################################################################## 30# 31# $Id: library-cfg.sh,v 1.8 2022/07/16 17:03:59 tom Exp $ 32# 33# Work around incompatible behavior introduced with gnat6, which causes 34# gnatmake to attempt to compile all of the C objects which might be part of 35# the project. This can only work if we provide the compiler flags (done here 36# by making a copy of the project file with that information filled in). 37model=$1 38shift 1 39input=$1 40shift 1 41param= 42while test $# != 0 43do 44 case "x$1" in 45 *-[OgDIWf]*) 46 test -n "$param" && param="$param," 47 param="$param\"$1\"" 48 ;; 49 *) 50 echo "${0##*/}: ignored option $1" >&2 51 ;; 52 esac 53 shift 1 54done 55 56SHARE="-- " 57test "x$model" = "xdynamic" && SHARE= 58 59SCRIPT=library-cfg.tmp 60cat >$SCRIPT <<EOF 61/for Library_Options use /{ 62 s,-- ,$SHARE, 63} 64/for Default_Switches ("C") use/{ 65 s,-- ,, 66 s% use .*% use($param);% 67} 68EOF 69 70sed -f "$SCRIPT" "$input" 71rc=$? 72rm -f "$SCRIPT" 73exit $rc 74