xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/opt-include.awk (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1*8feb0f0bSmrg#  Copyright (C) 2010-2020 Free Software Foundation, Inc.
21debfc3dSmrg#  Contributed by Michael Meissner (meissner@linux.vnet.ibm.com)
31debfc3dSmrg#
41debfc3dSmrg# This program is free software; you can redistribute it and/or modify it
51debfc3dSmrg# under the terms of the GNU General Public License as published by the
61debfc3dSmrg# Free Software Foundation; either version 3, or (at your option) any
71debfc3dSmrg# later version.
81debfc3dSmrg#
91debfc3dSmrg# This program is distributed in the hope that it will be useful,
101debfc3dSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
111debfc3dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
121debfc3dSmrg# GNU General Public License for more details.
131debfc3dSmrg#
141debfc3dSmrg# You should have received a copy of the GNU General Public License
151debfc3dSmrg# along with this program; see the file COPYING3.  If not see
161debfc3dSmrg# <http://www.gnu.org/licenses/>.
171debfc3dSmrg
181debfc3dSmrg# This Awk script reads in the option records and emits the include files
191debfc3dSmrg# listed by the HeaderInclude directive.
201debfc3dSmrg
211debfc3dSmrgBEGIN {
221debfc3dSmrg	h_next = 0
231debfc3dSmrg	c_next = 0
241debfc3dSmrg}
251debfc3dSmrg
261debfc3dSmrg(h_next != 0)	  { print "OPTIONS_H_EXTRA += $(srcdir)/" $1; h_next = 0 }
271debfc3dSmrg(c_next != 0)	  { print "OPTIONS_C_EXTRA += $(srcdir)/" $1; c_next = 0 }
281debfc3dSmrg/^HeaderInclude$/ { h_next = 1; c_next = 0 }
291debfc3dSmrg/^SourceInclude$/ { h_next = 0; c_next = 1 }
30