* configure.in: Rewrite to use autoconf.
[deliverable/binutils-gdb.git] / ld / emultempl / m88kbcs.em
CommitLineData
a6152e39
DM
1# This shell script emits a C file. -*- C -*-
2# It does some substitutions.
38cae0cd 3cat >e${EMULATION_NAME}.c <<EOF
a6152e39
DM
4/* This file is is generated by a shell script. DO NOT EDIT! */
5
6/* emulate the original gld for the given ${EMULATION_NAME}
4a6afc88 7 Copyright (C) 1991, 1993 Free Software Foundation, Inc.
a6152e39
DM
8 Written by Steve Chamberlain steve@cygnus.com
9
10This file is part of GLD, the Gnu Linker.
11
12This program is free software; you can redistribute it and/or modify
13it under the terms of the GNU General Public License as published by
14the Free Software Foundation; either version 2 of the License, or
15(at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
943fbd5b 24Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
a6152e39
DM
25
26#define TARGET_IS_${EMULATION_NAME}
27
28#include "bfd.h"
29#include "sysdep.h"
4a6afc88
ILT
30#include "bfdlink.h"
31
a6152e39 32#include "ld.h"
a6152e39
DM
33#include "ldemul.h"
34#include "ldfile.h"
35#include "ldmisc.h"
4a6afc88 36#include "ldmain.h"
a6152e39
DM
37
38static void
39gld${EMULATION_NAME}_before_parse()
40{
4a6afc88
ILT
41 link_info.lprefix = "@";
42 link_info.lprefix_len = 1;
a6152e39
DM
43
44 ldfile_output_architecture = bfd_arch_${ARCH};
45}
46
47static char *
48gld${EMULATION_NAME}_get_script(isfile)
49 int *isfile;
50EOF
51
d59e5a47 52if test -n "$COMPILE_IN"
a6152e39
DM
53then
54# Scripts compiled in.
55
56# sed commands to quote an ld script as a C string.
57sc='s/["\\]/\\&/g
58s/$/\\n\\/
d4e5e3c3
DM
591s/^/"/
60$s/$/n"/
a6152e39
DM
61'
62
38cae0cd 63cat >>e${EMULATION_NAME}.c <<EOF
a6152e39 64{
a6152e39
DM
65 *isfile = 0;
66
4a6afc88 67 if (link_info.relocateable == true && config.build_constructors == true)
a6152e39 68 return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
4a6afc88 69 else if (link_info.relocateable == true)
a6152e39
DM
70 return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`;
71 else if (!config.text_read_only)
72 return `sed "$sc" ldscripts/${EMULATION_NAME}.xbn`;
73 else if (!config.magic_demand_paged)
74 return `sed "$sc" ldscripts/${EMULATION_NAME}.xn`;
75 else
76 return `sed "$sc" ldscripts/${EMULATION_NAME}.x`;
77}
78EOF
79
80else
81# Scripts read from the filesystem.
82
38cae0cd 83cat >>e${EMULATION_NAME}.c <<EOF
a6152e39 84{
a6152e39
DM
85 *isfile = 1;
86
4a6afc88 87 if (link_info.relocateable == true && config.build_constructors == true)
a6152e39 88 return "ldscripts/${EMULATION_NAME}.xu";
4a6afc88 89 else if (link_info.relocateable == true)
a6152e39
DM
90 return "ldscripts/${EMULATION_NAME}.xr";
91 else if (!config.text_read_only)
92 return "ldscripts/${EMULATION_NAME}.xbn";
93 else if (!config.magic_demand_paged)
94 return "ldscripts/${EMULATION_NAME}.xn";
95 else
96 return "ldscripts/${EMULATION_NAME}.x";
97}
98EOF
99
100fi
101
38cae0cd 102cat >>e${EMULATION_NAME}.c <<EOF
a6152e39
DM
103
104struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
105{
106 gld${EMULATION_NAME}_before_parse,
107 syslib_default,
108 hll_default,
109 after_parse_default,
39a6e282 110 after_open_default,
a6152e39
DM
111 after_allocation_default,
112 set_output_arch_default,
113 ldemul_default_target,
114 before_allocation_default,
115 gld${EMULATION_NAME}_get_script,
116 "${EMULATION_NAME}",
117 "${OUTPUT_FORMAT}"
118};
119EOF
This page took 0.102324 seconds and 4 git commands to generate.