# This shell script emits a C file. -*- C -*-
# It does some substitutions.
+if [ -z "$MACHINE" ]; then
+ OUTPUT_ARCH=${ARCH}
+else
+ OUTPUT_ARCH=${ARCH}:${MACHINE}
+fi
cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
#define TARGET_IS_${EMULATION_NAME}
-#include <ctype.h>
-
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
#include "libiberty.h"
+#include "safe-ctype.h"
#include "ld.h"
#include "ldmain.h"
static void
gld${EMULATION_NAME}_before_parse()
{
- ldfile_output_architecture = bfd_arch_${ARCH};
+ const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
+ if (arch)
+ {
+ ldfile_output_architecture = arch->arch;
+ ldfile_output_machine = arch->mach;
+ ldfile_output_machine_name = arch->printable_name;
+ }
+ else
+ ldfile_output_architecture = bfd_arch_${ARCH};
config.dynamic_link = true;
config.has_shared = true;
}
if (entry->d_name[6 + len] == '\0')
;
else if (entry->d_name[6 + len] == '.'
- && isdigit ((unsigned char) entry->d_name[7 + len]))
+ && ISDIGIT (entry->d_name[7 + len]))
;
else
continue;
for (s = entry->d_name + 6 + len; *s != '\0'; s++)
- if (*s != '.' && ! isdigit ((unsigned char) *s))
+ if (*s != '.' && ! ISDIGIT (*s))
break;
if (*s != '\0')
continue;