003 File Manager
Current Path:
/usr/src/contrib/elftoolchain/libelftc
usr
/
src
/
contrib
/
elftoolchain
/
libelftc
/
📁
..
📄
Makefile
(1.48 KB)
📄
Version.map
(296 B)
📄
_libelftc.h
(3.33 KB)
📄
elftc.3
(2.99 KB)
📄
elftc_bfd_find_target.3
(6.83 KB)
📄
elftc_bfdtarget.c
(2.18 KB)
📄
elftc_copyfile.3
(2.22 KB)
📄
elftc_copyfile.c
(2.92 KB)
📄
elftc_demangle.3
(3.45 KB)
📄
elftc_demangle.c
(2.98 KB)
📄
elftc_reloc_type_str.3
(2.36 KB)
📄
elftc_reloc_type_str.c
(30.64 KB)
📄
elftc_set_timestamps.3
(2.59 KB)
📄
elftc_set_timestamps.c
(2.49 KB)
📄
elftc_string_table.c
(9.36 KB)
📄
elftc_string_table_create.3
(6.7 KB)
📄
elftc_timestamp.3
(2.53 KB)
📄
elftc_timestamp.c
(1.91 KB)
📄
elftc_version.3
(2.75 KB)
📄
libelftc.h
(3.67 KB)
📄
libelftc_bfdtarget.c
(10.18 KB)
📄
libelftc_dem_arm.c
(22.61 KB)
📄
libelftc_dem_gnu2.c
(25.97 KB)
📄
libelftc_dem_gnu3.c
(86.29 KB)
📄
libelftc_hash.c
(2.2 KB)
📄
libelftc_vstr.c
(7.33 KB)
📄
make-toolchain-version
(2.76 KB)
📄
os.FreeBSD.mk
(182 B)
📄
os.Linux.mk
(87 B)
📄
os.NetBSD.mk
(74 B)
Editing: make-toolchain-version
#!/bin/sh # # This script generates a project-wide version identifier for use by # the `elftc_version()' API. # # $Id: make-toolchain-version 3731 2019-04-06 14:28:34Z jkoshy $ # # Defaults. # buildhost=`uname -s` elftcname="elftoolchain" options="e:h:o:r:t:" top="" version="HEAD" versionfile="elftc_version.c" progname=`basename ${0}` usage() { exec >&2 # Print a message, if supplied. if [ -n "${*}" ]; then echo "##${@}"; fi echo "Usage: ${progname} [options]" echo " Generate a toolchain-wide version number" echo " -e PROJECTNAME Set the project name [default: ${elftcname}]." echo " -h HOSTOS Set the build OS [default: ${buildhost}]." echo " -o OUTPUT Set the output file [default: ${versionfile}]." echo " -r VERSION Set the version string [default: ${version}]." echo " -t TOPDIR Set the top-of-tree directory [required]." exit 1 } # Determine the revision number for the source tree. # # - If CVS is detected, we use the string `unknown'. # - If SVN is detected, we use the `svninfo' tool to determine the # in-tree revision number. # - Otherwise, we use `git --describe'. get_revision_string() { v="unknown:unknown" if [ -d CVS ]; then # Look for CVS (NetBSD). v="cvs:unknown" elif [ -d .svn ]; then # An SVN checkout (SourceForge or FreeBSD). svnversion="$(svnversion 2>/dev/null)" if [ -n "${svnversion}" ]; then v="svn:${svnversion}" fi else # Try git (DragonflyBSD). gitversion="$(git describe --all --dirty --long 2> /dev/null)" if [ -n "${gitversion}" ]; then v="git:${gitversion}" fi fi echo "${v}" } # # Parse options. # while getopts ${options} option do case ${option} in 'e') elftcname="${OPTARG}" ;; 'h') buildhost="${OPTARG}" ;; 'o') versionfile="${OPTARG}" ;; 'r') version="${OPTARG}" ;; 't') top="${OPTARG}" ;; '?') usage ;; esac done [ -n "${top}" ] || usage curdir=`pwd` cd ${top} || usage "ERROR: Cannot change directory to \"${top}\"." # Determine the in-tree revision number. versionstring="$(get_revision_string)" || { echo "ERROR: cannot determine a revision number." 1>&2; exit 1 } cd ${curdir} || usage "Cannot change back to ${curdir}." # # Only replace the source file if its content has changed. # tmpfile=`mktemp ${TMPDIR:-/tmp}/MV.XXXXXXX` trap "rm -f ${tmpfile};" 0 1 2 3 15 cat > ${tmpfile} <<EOF /* WARNING: Generated by "${progname}". */ #include <sys/types.h> #include <libelftc.h> const char * elftc_version(void) { return "${elftcname} ${version} ${buildhost} ${versionstring}"; } EOF if ! cmp -s ${tmpfile} ${versionfile}; then echo "@ ${progname}: building \"${versionfile}\"." cp ${tmpfile} ${versionfile} || exit ${?} fi
Upload File
Create Folder