pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


nfstest_gcc_build.ksh93
Posted by Anonymous on Mon 12th Feb 2024 15:52
raw | new post
view followups (newest first): nfstest_gcc_build.ksh93 by Anonymous
modification of post by Anonymous (view diff)

  1. #!/usr/bin/ksh93
  2.  
  3. #
  4. # nfstest_gcc_build.ksh93
  5. #
  6. # Simple NFSv4 torture test by building gcc in parallel
  7. # on a NFS filesystem
  8. #
  9. set -o xtrace
  10. set -o errexit
  11.  
  12. #
  13. # build config
  14. #
  15. typeset config_cp_p_function_not_implemented_workaround=false
  16. typeset config_use_posix_ksh93_builtins=true
  17.  
  18. #
  19. # source checkout
  20. #
  21.  
  22. #time git -c checkout.workers=16 clone -b 'releases/gcc-13.2.0' --single-branch git://gcc.gnu.org/git/gcc.git
  23. #time git -c checkout.workers=16 clone -b 'releases/gcc-13.2.0' --single-branch https://github.com/gcc-mirror/gcc.git
  24. time git -c checkout.workers=16 clone -b 'releases/gcc-13.2.0' --single-branch git://repo.or.cz/gcc.git
  25.  
  26.  
  27. cd "$PWD/gcc/" || { sync ; sleep 5 ; cd gcc ; }
  28.  
  29. if $config_use_posix_ksh93_builtins ; then
  30.         PATH="/usr/ast/bin:/opt/ast/bin:$PATH"
  31. fi
  32.  
  33. #
  34. # patch sources and configure build
  35. #
  36.  
  37. # Cygwin: workaround for configure using cp -p where ln -s should be used
  38. # (this is an automake/autoconf issue, they should trust Cygwin and not use
  39. # ancient workarounds for issues which no longer exists)
  40. (set -o xtrace ; sed -i "s/as_ln_s='cp -pR'/as_ln_s='ln -s'/g" $(find . -name 'configure') )
  41.  
  42. if $config_use_posix_ksh93_builtins ; then
  43.         (set -o xtrace ; sed -i "s/\/bin\/sh/\/bin\/ksh93/g" $(find . -name 'configure') )
  44. fi
  45.  
  46. if $config_use_posix_ksh93_builtins ; then
  47.         ksh93 ./configure
  48. else
  49.         bash ./configure
  50. fi
  51.  
  52. if $config_cp_p_function_not_implemented_workaround ; then
  53.         # workaround for $ cp -p # failing with "Function not
  54.         # implemented" in older versions of ms-nfs41-client
  55.         if $config_use_posix_ksh93_builtins ; then
  56.                 (
  57.                         set -o xtrace
  58.                         sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\1\2 -A pt /g' \
  59.                                 $(find . -name 'Makefile' -o -name 'Makefile.in')
  60.                 )
  61.         else
  62.                 (
  63.                         set -o xtrace ; sed -i -r 's/(cp.*)([[:space:]]+-p[[:space:]]+)/\1\2--no-preserve=ownership /g' \
  64.                                 $(find . -name 'Makefile' -o -name 'Makefile.in')
  65.                 )
  66.         fi
  67. fi
  68.  
  69. if $config_use_posix_ksh93_builtins ; then
  70.         # replace /bin/sh with /bin/ksh93 for speed
  71.         (set -o xtrace ; sed -i -r 's/\/bin\/sh/\/bin\/ksh93/g' \
  72.                 $(find . -name 'Makefile' -o -name 'Makefile.in') )
  73. fi
  74.  
  75. #
  76. # build gcc
  77. #
  78. ksh93 -c 'export SHELL=/bin/ksh93 ; (yes | make -j6 all)'
  79. echo $?
  80.  
  81. echo "#Done."

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at