libtool/lineno
Thomas Tanner 47938d46eb * update all copyright notices to 2000
* doc/libtool.texi (using libltdl): document new lt_dlinfo struct,
  replace NULL with @code{NULL}, document lt_dlsetdata(),
  lt_dlgetdata() and lt_dlgetinfo()
* libltdl/Makefile.am: increment interface version number
* libltdl/configure.in: set version number to 1.1
* libltdl/ltdl.c: make some variables public by moving them
  to the info struct, add support for application specific data
  within module handles, new lt_dlsetdata(), lt_dlgetdata() and
  lt_dlgetinfo() functions,
  fix memory leaks, minor cleanups
* libltdl/ltdl.h: ditto
* mdemo/main.c: demonstrate use of lt_dlgetinfo,
  improved handling of errors

* ltconfig.in: set hardcode_into_libs = yes for GNU/Hurd, Linux
  and Solaris, only hardcode *all* run-paths if hardcode_into_libs
  is set to 'all', otherwise hardcode only user-specified rpaths
  into libraries
* ltmain.in: minor cleanups, we don't need to add user-specified
  rpaths to compile_rpath, finalize_rpath is sufficient

* ltconfig.in: transform linux* -> *linux-gnu* _after_ host_os has
  been set! (reported by Bruno Haible <haible@ilog.fr>)

* configure.in: AC_SUBST reload_flag, deplibs_check_method
  and file_magic_cmd

* README: use 'libtool --version' instead of 'ltconfig --version'
  (suggested by Francios Pinard <pinard@iro.umontreal.ca>
2000-01-13 00:28:09 +00:00

99 lines
2.2 KiB
Bash
Executable File

#! /bin/sh
# lineno - Replace instances of @LINENO@ with the file's current line number
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1997
# Copyright (C) 1992-2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
AWK=${AWK-awk}
delete=no
files=
progname=`echo "$0" | sed 's%^.*/%%'`
for arg
do
case "$arg" in
--delete) delete=yes ;;
--help)
cat <<EOF
Usage: $progname [OPTION]... FILE...
Substitute @LINENO@ for the current output line number.
--delete delete files that cannot be converted
--help display this message and exit
--version print version information
Each FILE is the name of a file to modify.
EOF
exit 0
;;
--version)
echo "GNU lineno 1.0"
exit 0
;;
-*)
echo "$progname: unrecognized option \`$arg'" 1>&2
exit 1
;;
*) files="$files $arg" ;;
esac
done
if test -z "$files"; then
echo "$progname: no FILES specified" 1>&2
exit 1
fi
# Manage a temp file.
tmpfile="$progname.$$"
trap "rm -f $tmpfile; exit 1" 1 2 15
status=0
for file in $files; do
if test -f "$file"; then :
else
status=1
echo "$progname: \`$file' is not a file" 1>&2
fi
# Skip empty files.
test -s "$file" || continue
# Transliterated from a section in autoconf (Autoconf 2.12).
$AWK '
/@LINENO@/ { printf "%d:", NR }
{ print }
' $file | sed '/@LINENO@/s/^\([0-9][0-9]*\):\(.*\)@LINENO@/\2\1/' > $tmpfile
if test -s "$tmpfile"; then
cp $tmpfile $file && continue
fi
if test "$delete" = yes; then
echo "$progname: deleting \`$file'" 1>&2
rm -f $file
fi
done
rm -f $tmpfile
exit $status