From 95244a0891bf9068d0e2fb22f42db234c46d8179 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sun, 7 Apr 2019 23:50:32 +0100 Subject: Configure script using our build programs in final steps In order to get a consistent final result, in its later steps, the configure script uses our own build of the basic command-line tools (like `cat', `awk'). Also, a correction was made to the short option parsing errors when an unwanted argument is given, and the `-?*' was changed to `-'?'*' to avoid un-necessary shell interpretation (for example giving unreasonable results). --- .file-metadata | Bin 4793 -> 4789 bytes configure | 79 ++++++++++++++++++++++++++++++++------------------------- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/.file-metadata b/.file-metadata index 4678426..045a6f0 100644 Binary files a/.file-metadata and b/.file-metadata differ diff --git a/configure b/configure index 0fcd68a..7a97d93 100755 --- a/configure +++ b/configure @@ -39,6 +39,7 @@ host_cc=0 software_dir= existing_conf=0 minmapsize=10000000000 +scriptname="./configure" @@ -46,11 +47,10 @@ minmapsize=10000000000 # Output of --help # ---------------- -me=$0 # Executable file name. print_help() { # Print the output. cat <0{ c++; \ - if(c==1) \ - { \ - if('$num'==1) printf("%s", $0); \ - else printf("%s", $0); \ - } \ - else if(c=='$num') printf(" and %s\n", $0); \ - else printf(", %s", $0)}' + .local/bin/cat "$@" \ + | .local/bin/sort \ + | .local/bin/awk 'NF>0 { \ + c++; \ + if(c==1) \ + { \ + if('$num'==1) printf("%s", $0); \ + else printf("%s", $0); \ + } \ + else if(c=='$num') printf(" and %s\n", $0); \ + else printf(", %s", $0) \ + }' } -# Separate the parts by context. +# Report the different software in separate contexts (separating Python and +# TeX packages from the C/C++ programs and libraries). proglibs=$(prepare_name_version $verdir/bin/* $verdir/lib/*) pymodules=$(prepare_name_version $verdir/python/*) texpkg=$(prepare_name_version $verdir/tex/texlive) # Write them as one paragraph for LaTeX. pkgver=$mtexdir/dependencies.tex -echo "This research was done with the following free" > $pkgver -echo "software programs and libraries: $proglibs." >> $pkgver -npython=$(ls $verdir/python/* | wc -l) +.local/bin/echo "This research was done with the following free" > $pkgver +.local/bin/echo "software programs and libraries: $proglibs." >> $pkgver +npython=$(.local/bin/ls $verdir/python/* | .local/bin/wc -l) if [ $npython != 0 ]; then - echo "Within Python, the following modules were used: " >> $pkgver - echo "$pymodules." >> $pkgver + .local/bin/echo "Within Python, the following modules" >> $pkgver + echo "were used: $pymodules." >> $pkgver fi -echo "The \LaTeX{} source of the paper was compiled to make" >> $pkgver -echo "the PDF using the following packages: $texpkg. We are" >> $pkgver -echo "very grateful to all their creators for freely" >> $pkgver -echo "providing this necessary infrastructure. This " >> $pkgver -echo "research (and many others) would not be possible" >> $pkgver -echo "without them." >> $pkgver +.local/bin/echo "The \LaTeX{} source of the paper was compiled" >> $pkgver +.local/bin/echo "to make the PDF using the following packages:" >> $pkgver +.local/bin/echo "$texpkg. We are very grateful to all their" >> $pkgver +.local/bin/echo "creators for freely providing this necessary" >> $pkgver +.local/bin/echo "infrastructure. This research (and many " >> $pkgver +.local/bin/echo "others) would not be possible without them." >> $pkgver -# Final step: the Makefile -# -------------------------- +# Final step: available Makefile +# ------------------------------ # -# To see why this is the last step of the configuration, see above (when we -# delete the top-level Makefile at the start of this script). -ln -s $(pwd)/reproduce/src/make/top.mk Makefile +# We only want `make' to work after the configuration is complete. So we +# will only put in the top-level Makefile after all the steps above are +# done. +.local/bin/ln -s $(pwd)/reproduce/src/make/top.mk Makefile -- cgit v1.2.1