xref: /netbsd-src/external/bsd/pcc/dist/pcc/driver/mkopt.sh (revision 411dcbec990c8aa9c57d3bd2f4bcacadec0b1ab5)
1#	Id
2#	$NetBSD: mkopt.sh,v 1.1.1.1 2016/02/09 20:29:13 plunky Exp $
3
4#-
5# Copyright (c) 2014 Iain Hibbert.
6#
7# Permission is hereby granted, free of charge, to any person obtaining a copy
8# of this software and associated documentation files (the "Software"), to deal
9# in the Software without restriction, including without limitation the rights
10# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11# copies of the Software, and to permit persons to whom the Software is
12# furnished to do so, subject to the following conditions:
13#
14# The above copyright notice and this permission notice shall be included in
15# all copies or substantial portions of the Software.
16#
17# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23# THE SOFTWARE.
24
25# emit a NULL terminated array of quoted strings
26array()
27{
28	echo -n "{"
29	while
30		test $# -gt 0
31	do
32		echo -n " \"$1\","
33		shift
34	done
35	echo -n " NULL }"
36}
37
38cat << EOF
39/**************************************
40 * This file is generated by mkopt.sh *
41 **************************************/
42	
43#include "driver.h"
44
45const char prog_cpp[] = "${PROG_CPP:-cpp}";
46const char prog_ccom[] = "${PROG_CCOM:-ccom}";
47const char prog_cxxcom[] = "${PROG_CXXCOM:-cxxcom}";
48const char prog_fcom[] = "${PROG_FCOM:-fcom}";
49const char prog_asm[] = "${PROG_ASM:-as}";
50const char prog_ld[] = "${PROG_LD:-ld}";
51
52const char dir_libexec[] = "${LIBEXEC:-/usr/libexec}";
53
54const char dir_stdinc[] = "${STDINC:=/usr/include}";
55const char dir_pccinc[] = "${PCCINC:-${STDINC}/pcc}";
56const char dir_pccinc[] = "${PCCINC:-${STDINC}/pcc}";
57const char dir_ftninc[] = "${FTNINC:-${STDINC}/ftn}";
58
59const char dir_stdlib[] = "${STDLIB:=/usr/lib}";
60const char dir_pcclib[] = "${PCCLIB:-${STDLIB}/pcc}";
61const char dir_pxxlib[] = "${PXXLIB:-${STDLIB}/p++}";
62const char dir_ftnlib[] = "${FTNLIB:-${STDLIB}/ftn}";
63
64const struct target *target = &targ_${TARGET};
65
66const char *cc_names[] = $(array ${CC_NAMES:-cc pcc});
67const char *cpp_names[] = $(array ${CPP_NAMES:-cpp pcpp});
68const char *cxx_names[] = $(array ${CXX_NAMES:-c++ p++});
69const char *ftn_names[] = $(array ${FTN_NAMES:-f77 fortran p77 pfortran});
70
71/**************************************
72 * This file is generated by mkopt.sh *
73 **************************************/
74EOF
75