#!/bin/sh
# genscripts.sh - generate the ld-emulation-target specific files
-# Copyright 2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is part of the Gnu Linker.
#
# enable_initfini_array \
# this_emulation \
# optional:
-# tool_dir \
-# customizer_script
+# tool_dir
#
# Sample usage:
#
ENABLE_INITFINI_ARRAY=$2
EMULATION_NAME=$3
TOOL_LIB=$4
-CUSTOMIZER_SCRIPT=$5
-
-if [ "x${CUSTOMIZER_SCRIPT}" = "x" ] ; then
- CUSTOMIZER_SCRIPT=${EMULATION_NAME}
-fi
-CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${CUSTOMIZER_SCRIPT}.sh"
# Include the emulation-specific parameters:
+CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${EMULATION_NAME}.sh"
. ${CUSTOMIZER_SCRIPT}
if test -d ldscripts; then
if [ "x${use_sysroot}" = "xyes" ] ; then
lib="=${lib}"
fi
+ skip_lib=no
if test -n "${LIBPATH_SUFFIX}"; then
case "${lib}" in
*${LIBPATH_SUFFIX})
*) lib_path1=${lib_path1}:${lib} ;;
esac ;;
*)
- case :${lib_path1}: in
- *:${lib}${LIBPATH_SUFFIX}:*) ;;
- ::) lib_path1=${lib}${LIBPATH_SUFFIX} ;;
- *) lib_path1=${lib_path1}:${lib}${LIBPATH_SUFFIX} ;;
- esac ;;
+ if test -n "${LIBPATH_SUFFIX_SKIP}"; then
+ case "${lib}" in
+ *${LIBPATH_SUFFIX_SKIP}) skip_lib=yes ;;
+ esac
+ fi
+ if test "${skip_lib}" = "no"; then
+ case :${lib_path1}: in
+ *:${lib}${LIBPATH_SUFFIX}:*) ;;
+ ::) lib_path1=${lib}${LIBPATH_SUFFIX} ;;
+ *) lib_path1=${lib_path1}:${lib}${LIBPATH_SUFFIX} ;;
+ esac
+ fi ;;
+ esac
+ fi
+ if test "${skip_lib}" = "no"; then
+ case :${lib_path1}:${lib_path2}: in
+ *:${lib}:*) ;;
+ *::) lib_path2=${lib} ;;
+ *) lib_path2=${lib_path2}:${lib} ;;
esac
fi
- case :${lib_path1}:${lib_path2}: in
- *:${lib}:*) ;;
- *::) lib_path2=${lib} ;;
- *) lib_path2=${lib_path2}:${lib} ;;
- esac
done
fi
}
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xa
fi
-case " $EMULATION_LIBPATH " in
- *" ${EMULATION_NAME} "*) COMPILE_IN=true;;
+case "$COMPILE_IN: $EMULATION_LIBPATH " in
+ :*" ${EMULATION_NAME} "*) COMPILE_IN=yes;;
esac
# PR ld/5652: