xref: /minix3/external/bsd/flex/flex2netbsd (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1357f1050SThomas Veerman#! /bin/sh
2357f1050SThomas Veerman#
3*0a6a1f1dSLionel Sambuc#	$NetBSD: flex2netbsd,v 1.3 2014/10/29 18:28:36 christos Exp $
4357f1050SThomas Veerman#
5357f1050SThomas Veerman# Copyright (c) 2000 The NetBSD Foundation, Inc.
6357f1050SThomas Veerman# All rights reserved.
7357f1050SThomas Veerman#
8357f1050SThomas Veerman# Redistribution and use in source and binary forms, with or without
9357f1050SThomas Veerman# modification, are permitted provided that the following conditions
10357f1050SThomas Veerman# are met:
11357f1050SThomas Veerman# 1. Redistributions of source code must retain the above copyright
12357f1050SThomas Veerman#    notice, this list of conditions and the following disclaimer.
13357f1050SThomas Veerman# 2. Redistributions in binary form must reproduce the above copyright
14357f1050SThomas Veerman#    notice, this list of conditions and the following disclaimer in the
15357f1050SThomas Veerman#    documentation and/or other materials provided with the distribution.
16357f1050SThomas Veerman#
17357f1050SThomas Veerman# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18357f1050SThomas Veerman# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19357f1050SThomas Veerman# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20357f1050SThomas Veerman# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21357f1050SThomas Veerman# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22357f1050SThomas Veerman# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23357f1050SThomas Veerman# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24357f1050SThomas Veerman# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25357f1050SThomas Veerman# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26357f1050SThomas Veerman# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27357f1050SThomas Veerman# POSSIBILITY OF SUCH DAMAGE.
28357f1050SThomas Veerman#
29357f1050SThomas Veerman# flex2netbsd:  convert a flex tree into a
30357f1050SThomas Veerman# netbsd flex source tree, under src/external/bsd/flex/dist,
31357f1050SThomas Veerman# based on flex2netbsd by Bernd Ernesti and changes by Simon Burge
32357f1050SThomas Veerman#
33357f1050SThomas Veerman# Rough instructions for importing new flex release:
34357f1050SThomas Veerman#
35357f1050SThomas Veerman#	$ cd /some/where/temporary
36357f1050SThomas Veerman#	$ tar xpfz /new/flex/release/tar/file
37*0a6a1f1dSLionel Sambuc#	$ sh /usr/src/external/bsd/flex/dist/flex2netbsd flex-2.5.x
38*0a6a1f1dSLionel Sambuc#	$ cd flex-2.5.x
39357f1050SThomas Veerman#	$ cvs import -m "Import flex 2.5.x" src/external/bsd/flex/dist FLEX flex-2-5-x
40357f1050SThomas Veerman#	$ run ./configure
41357f1050SThomas Veerman#	$ run make
42357f1050SThomas Veerman#	check the config file and copy it to /usr/src/external/bsd/flex/include
43357f1050SThomas Veerman#	check the manual page against our copy if there are new options and
44357f1050SThomas Veerman#	update
45357f1050SThomas Veerman
46*0a6a1f1dSLionel Sambucif [ $# -ne 1 ]; then echo "flex2netbsd src"; exit 1; fi
47357f1050SThomas Veerman
48357f1050SThomas Veermanr=$1
49357f1050SThomas Veerman
50357f1050SThomas Veermancase "$r" in
51357f1050SThomas Veerman	/*)
52357f1050SThomas Veerman		;;
53357f1050SThomas Veerman	*)
54357f1050SThomas Veerman		r=`/bin/pwd`/$r
55357f1050SThomas Veerman		;;
56357f1050SThomas Veermanesac
57357f1050SThomas Veerman
58*0a6a1f1dSLionel Sambuccd "$r"
59357f1050SThomas Veerman
60357f1050SThomas Veerman### Remove the $'s around RCS tags
61*0a6a1f1dSLionel Sambuccleantags .
62357f1050SThomas Veerman
63357f1050SThomas Veermanexit 0
64