From c8a68d987b4332bc57e8fe9e75ad7d5d4297d880 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Tue, 14 Oct 2008 21:30:27 +0000 Subject: Introduce the notion of a 'sample comment'. - presence of the sample's reported.by file is now mandatory. - when saving a sample, reporter name & URL are queried, to avoid operator forget about creating the reported.by file. - when saving a sample, one can store a few-liner comment. - when recalling a sample, the reporter name, URL and comment (if present) are printed. - update the powerpc-e500v2-linux-gnuspe sample to include Nate's comment (from his original mail). - update all samples that were missing the reported.by file. /trunk/scripts/saveSample.sh | 46 35 11 0 ++++++++++++++++++------ /trunk/scripts/showSamples.sh | 12 6 6 0 +++--- /trunk/samples/powerpc-e500v2-linux-gnuspe/reported.by | 15 15 0 0 ++++++++ /trunk/samples/samples.mk | 22 17 5 0 +++++++++-- 4 files changed, 73 insertions(+), 22 deletions(-) diff --git a/samples/arm-unknown-eabi/reported.by b/samples/arm-unknown-eabi/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/arm-unknown-elf/reported.by b/samples/arm-unknown-elf/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/arm-unknown-linux-uclibc/reported.by b/samples/arm-unknown-linux-uclibc/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/arm-unknown-linux-uclibcgnueabi/reported.by b/samples/arm-unknown-linux-uclibcgnueabi/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/armeb-unknown-linux-gnu/reported.by b/samples/armeb-unknown-linux-gnu/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/armeb-unknown-linux-gnueabi/reported.by b/samples/armeb-unknown-linux-gnueabi/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/armeb-unknown-linux-uclibc/reported.by b/samples/armeb-unknown-linux-uclibc/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/armeb-unknown-linux-uclibcgnueabi/reported.by b/samples/armeb-unknown-linux-uclibcgnueabi/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/i586-geode-linux-uclibc/reported.by b/samples/i586-geode-linux-uclibc/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/i686-nptl-linux-gnu/reported.by b/samples/i686-nptl-linux-gnu/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/ia64-unknown-linux-gnu/reported.by b/samples/ia64-unknown-linux-gnu/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/mips-unknown-linux-uclibc/reported.by b/samples/mips-unknown-linux-uclibc/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/samples/powerpc-e500v2-linux-gnuspe/reported.by b/samples/powerpc-e500v2-linux-gnuspe/reported.by index acce50e..ba468c0 100644 --- a/samples/powerpc-e500v2-linux-gnuspe/reported.by +++ b/samples/powerpc-e500v2-linux-gnuspe/reported.by @@ -1,2 +1,17 @@ reporter_name="Nate CASE" reporter_url="http://sourceware.org/ml/crossgcc/2008-10/msg00016.html" +reporter_comment="This is a sample config file for Freescale e500v2 processors (e.g., +MPC8548, MPC8572). It uses eglibc (for e500/SPE patches) and a recent +gcc (4.3.1, for e500v2 DPFP support) and will generate appropriate +dual-precision floating point instructions by default. + +Note: If building a Linux kernel with this toolchain, you will want to +make sure -mno-spe AND -mspe=no are passed to gcc to prevent SPE +ABI/instructions from getting into the kernel (which is currently +unsupported). At this time, the kernel build system only passes +-mno-spe by default (this should be fixed soon hopefully). + +A binutils snapshot is used to fix a bug present in 2.18 preventing +U-Boot from being compiled (CodeSourcery issue #2297: internal.h +(ELF_IS_SECTION_IN_SEGMENT): Adjust to cope with segments at the end of +memory)." diff --git a/samples/samples.mk b/samples/samples.mk index fc0581f..5ea7276 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -35,18 +35,30 @@ PHONY += $(CT_SAMPLES) $(CT_SAMPLES): @cp $(call sample_dir,$@)/crosstool.config .config @$(MAKE) -rf $(CT_NG) oldconfig + @echo + @echo '***********************************************************' + @echo + @( . $(call sample_dir,$@)/reported.by; \ + echo "Initially reported by: $${reporter_name:-Yann E. MORIN}"; \ + echo "URL: $${reporter_url:-http://ymorin.is-a-geek.org/}"; \ + if [ -n "$${reporter_comment}" ]; then \ + echo ; \ + echo "Comment:"; \ + printf "$${reporter_comment}\n"; \ + fi; \ + echo ; \ + echo '***********************************************************'; \ + ) @if grep -E '^CT_EXPERIMENTAL=y$$' .config >/dev/null 2>&1; then \ - echo ''; \ - echo '***********************************************************'; \ - echo ''; \ + echo ; \ echo 'WARNING! This sample may enable experimental features.'; \ echo ' Please be sure to review the configuration prior'; \ echo ' to building and using your toolchain!'; \ echo 'Now, you have been warned!'; \ - echo ''; \ + echo ; \ echo '***********************************************************'; \ - echo ''; \ fi + @echo @echo 'Now configured for "$@"' # The 'sample_dir' function prints the directory in which the sample is, diff --git a/samples/x86_64-unknown-linux-uclibc/reported.by b/samples/x86_64-unknown-linux-uclibc/reported.by new file mode 100644 index 0000000..e69de29 diff --git a/scripts/saveSample.sh b/scripts/saveSample.sh index 1958194..c6b037d 100755 --- a/scripts/saveSample.sh +++ b/scripts/saveSample.sh @@ -5,8 +5,11 @@ # What we need to save: # - the .config file -# - the kernel .config file if specified # - the uClibc .config file if uClibc selected +# - info about who reported the sample + +# We'll need the stdout later, save it +exec 7>&1 . "${CT_LIB_DIR}/scripts/functions" @@ -15,8 +18,8 @@ exec >/dev/null rm -f "${tmp_log_file}" # Parse the configuration file -CT_TestOrAbort "Configuration file not found. Please create one." -f "${CT_TOP_DIR}/.config" -. "${CT_TOP_DIR}/.config" +CT_TestOrAbort "Configuration file not found. Please create one." -f .config +. .config # Do not use a progress bar unset CT_LOG_PROGRESS_BAR @@ -29,7 +32,7 @@ CT_DoBuildTargetTuple # Kludge: if any of the config options needs either CT_TARGET or CT_TOP_DIR, # re-parse them: -. "${CT_TOP_DIR}/.config" +. .config # Override log options unset CT_LOG_PROGRESS_BAR CT_LOG_ERROR CT_LOG_INFO CT_LOG_EXTRA CT_LOG_DEBUG LOG_ALL @@ -37,8 +40,8 @@ CT_LOG_WARN=y CT_LOG_LEVEL_MAX="WARN" # Create the sample directory -if [ ! -d "${CT_TOP_DIR}/samples/${CT_TARGET}" ]; then - mkdir -p "${CT_TOP_DIR}/samples/${CT_TARGET}" +if [ ! -d "samples/${CT_TARGET}" ]; then + mkdir -p "samples/${CT_TARGET}" fi # Save the crosstool-NG config file @@ -46,8 +49,8 @@ sed -r -e 's|^(CT_PREFIX_DIR)=.*|\1="${HOME}/x-tools/${CT_TARGET}"|;' \ -e 's|^# CT_LOG_TO_FILE is not set$|CT_LOG_TO_FILE=y|;' \ -e 's|^# CT_LOG_FILE_COMPRESS is not set$|CT_LOG_FILE_COMPRESS=y|;' \ -e 's|^(CT_LOCAL_TARBALLS_DIR)=.*|\1="${HOME}/src"|;' \ - <"${CT_TOP_DIR}/.config" \ - >"${CT_TOP_DIR}/samples/${CT_TARGET}/crosstool.config" + <.config \ + >"samples/${CT_TARGET}/crosstool.config" # Function to copy a file to the sample directory # Needed in case the file is already there (think of a previously available sample) @@ -71,12 +74,33 @@ fi # Save the uClibc .config file if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then # We save the file, and then point the saved sample to this file - CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config" + CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config" sed -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE=).+$|\1"'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \ - "${CT_TOP_DIR}/samples/${CT_TARGET}/crosstool.config" + "samples/${CT_TARGET}/crosstool.config" else # remove any dangling files - for f in "${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_LIBC}-"*.config; do + for f in "samples/${CT_TARGET}/${CT_LIBC}-"*.config; do if [ -f "${f}" ]; then rm -f "${f}"; fi done fi + +# Restore stdout now, to be interactive +exec >&7 + +# Fill-in the reported-by info +[ -f "samples/${CT_TARGET}/reported.by" ] && . "samples/${CT_TARGET}/reported.by" +old_name="${reporter_name}" +old_url="${reporter_url}" +read -p "Reporter name [${reporter_name}]: " reporter_name +read -p "Reporter URL [${reporter_url}]: " reporter_url +if [ -n "${reporter_comment}" ]; then + echo "Old comment if you need to copy-paste:" + printf "${reporter_comment}" +fi +echo "Reporter comment (Ctrl-D to finish):" +reporter_comment=$(cat) + +( echo "reporter_name=\"${reporter_name:=${old_name}}\"" + echo "reporter_url=\"${reporter_url:=${old_url}}\"" + printf "reporter_comment=\"${reporter_comment}\"\n" +) >"samples/${CT_TARGET}/reported.by" diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh index d946db9..a6c6963 100755 --- a/scripts/showSamples.sh +++ b/scripts/showSamples.sh @@ -83,17 +83,17 @@ dump_single_sample() { [ "${CT_CC_LANG_OBJCXX}" = "y" ] && printf ", Objective-C++" [ -n "${CT_CC_LANG_OTHERS}" ] && printf "\\\\\\\\ Others: ${CT_CC_LANG_OTHERS}" printf " " - if [ -f "${sample_top}/samples/${sample}/reported.by" ]; then - ( . "${sample_top}/samples/${sample}/reported.by" + ( . "${sample_top}/samples/${sample}/reported.by" + if [ -n "${reporter_name}" ]; then if [ -n "${reporter_url}" ]; then printf "| [[${reporter_url}|${reporter_name}]] " else printf "| ${reporter_name} " fi - ) - else - printf "| [[http://ymorin.is-a-geek.org/|YEM]] " - fi + else + printf "| [[http://ymorin.is-a-geek.org/|YEM]] " + fi + ) sample_updated=$(date -u "+%Y%m%d" \ -d "$(LC_ALL=C svn info ${sample_top}/samples/${sample} \ |GREP_OPTIONS= egrep '^Last Changed Date:' \ -- cgit v0.10.2-6-g49f6