Create Lint Libraries?

Fred Fish fnf at estinc.UUCP
Sun May 21 10:55:07 AEST 1989


In article <202 at melpar.UUCP> toppin at melpar.UUCP (Doug Toppin) writes:
>I have been trying to create a lint library with
>an SCO Xenix 386 system and have not been able to
>do it properly. I have not been able to find an example
>on how to use the '-o' option with lint.

Here is the shell script I use to make lint libraries on a variety of
different systems.  I just tested it under SCO 2.3.1 and it seemed to
work just fine.  If the name of your library is mylib.c, just make a
lint source file in mylib.lint by stripping out the bodies of all the
functions and adding "/*LINTLIBRARY*/" at the beginning of mylib.lint.
Then do "mklintlib mylib.lint llibmylib.ln", install the file as
/usr/lib/llibmylib.ln, and to use with a program myprog.c that references
the library, run "lint myprog.c -lmylib".

-Fred

# mklintlib --- make a lint library, under either System V or 4.2 BSD
#
# usage:  mklintlib <infile> <outfile>
#

if test $# -ne 2
then
	echo "usage: mklintlib <infile> <outfile>"
	exit 1
fi

if grep SIGTSTP /usr/include/signal.h >/dev/null
then							# BSD
	if test -r /usr/include/whoami.h		# 4.1
	then
		/lib/cpp -C -Dlint $1 >hlint
		(/usr/lib/lint/lint1 <hlint >$2) 2>&1 | grep -v warning
	else						# 4.2
		lint -Cxxxx $1
		mv llib-lxxxx.ln $2
	fi
else							# USG
	cc -E -C -Dlint $1 | /usr/lib/lint1 -vx -Hhlint >$2
	rm -f hlint
fi
exit 0							# don't kill make
-- 
# Fred Fish, 1835 E. Belmont Drive, Tempe, AZ 85284,  USA
# 1-602-491-0048           asuvax!{nud,mcdphx}!estinc!fnf



More information about the Comp.unix.xenix mailing list