# Convert text files to compilable C arrays.
#
-# Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2007-2017 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-output=$1
-shift
-
-if test -z "$output" || test -z "$1"; then
+if test -z "$1" || test -z "$2"; then
echo "Usage: $0 OUTPUTFILE INPUTFILE..."
exit 1
fi
+output=$1
+shift
+
if test -e "$output"; then
echo "Output file \"$output\" already exists; refusing to overwrite."
exit 1
done
echo >> $output
-echo "const char *const xml_builtin[][2] = {" >> $output
+
+echo "extern const char *const xml_builtin[][2] = {" >> $output
for input; do
basename=`echo $input | sed 's,.*/,,'`