X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=hints%2Fos2.sh;h=77085a89b47c330f64425c794e25facc480cbb15;hb=522b859adcc800ddbbe593fba580633bb305644f;hp=eb11ff593e0b5fd602612bcbfa7e225165054d23;hpb=37286744a4c80f0fbda1675ea568e7231eb799a0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/hints/os2.sh b/hints/os2.sh index eb11ff5..77085a8 100644 --- a/hints/os2.sh +++ b/hints/os2.sh @@ -108,6 +108,18 @@ exe_ext='.exe' # We provide it i_dlfcn='define' +# The default one uses exponential notation between 0.0001 and 0.1 +d_Gconvert='gcvt_os2((x),(n),(b))' + +cat > UU/uselongdouble.cbu <<'EOCBU' +# This script UU/uselongdouble.cbu will get 'called-back' by Configure +# after it has prompted the user for whether to use long doubles. +# If we will use them, let Configure choose us a Gconvert. +case "$uselongdouble:$d_longdbl:$d_sqrtl:$d_modfl" in +"$define:$define:$define:$define") d_Gconvert='' ;; +esac +EOCBU + # -Zomf build has a problem with _exit() *flushing*, so the test # gets confused: fflushNULL="define" @@ -169,9 +181,9 @@ else else d_fork='undef' fi - lddlflags="-Zdll -Zomf -Zmt -Zcrtdll $ld_dll_optimize" + lddlflags="-Zdll -Zomf -Zmt -Zcrtdll -Zlinker /e:2" # Recursive regmatch may eat 2.5M of stack alone. - ldflags='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000' + ldflags='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000 -Zlinker /e:2' if [ $emxcrtrev -ge 50 ]; then ccflags="-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. $_defemxcrtrev" else @@ -282,39 +294,122 @@ else fi fi +for f in less.exe less.sh less.ksh less.cmd more.exe more.sh more.ksh more.cmd ; do + if test -z "$pager"; then + pager="`./UU/loc $f '' $pth`" + fi +done +if test -z "$pager"; then + pager='cmd /c more' +fi + # Apply patches if needed case "$0$running_c_cmd" in *[/\\]Configure|*[/\\]Configure.|Configure|Configure.) # Skip Configure.cmd - if grep "^libnames" ./Configure > /dev/null; then + if test "Xyes" = "X$configure_cmd_loop"; then + cat <&2 +!!! +!!! PANIC: Loop of self-invocations detected, aborting! +!!! +EOC + exit 20 + fi + configure_cmd_loop=yes + export configure_cmd_loop + + configure_needs_patch='' + if test -s ./os2/diff.configure; then + if ! grep "^#OS2-PATCH-APPLIED" ./Configure > /dev/null; then + configure_needs_patch=yes + fi + fi + if test -n "$configure_needs_patch"; then # Not patched! + # Restore the initial command line arguments if test -f ./Configure.cmd ; then - echo "!!!" >&2 - echo "!!! I see that what is running is ./Configure." >&2 - echo "!!! ./Configure is not patched, but ./Configure.cmd exists." >&2 - echo "!!!" >&2 - echo "!!! You are supposed to run Configure.cmd, not Configure" >&2 - echo "!!! after an automagic patching." >&2 - echo "!!!" >&2 - echo "!!! If you insist on running Configure, please" >&2 - echo "!!! patch it manually from ./os2/diff.configure." >&2 - echo "!!!" >&2 + cat <&2 +!!! +!!! I see that what is running is ./Configure. +!!! ./Configure is not patched, but ./Configure.cmd exists. +!!! +!!! You are supposed to run Configure.cmd, not Configure +!!! after an automagic patching. +!!! +!!! If you insist on running Configure, you may +!!! patch it manually from ./os2/diff.configure. +!!! +!!! However, I went through incredible hoolahoops, and I expect I can +!!! auto-restart Configure.cmd myself. I will start it with arguments: +!!! +!!! Configure.cmd $args_exp +!!! +EOC + rp='Do you want to auto-restart Configure.cmd?' + dflt='y' + . UU/myread + case "$ans" in + [yY]) echo >&4 "Okay, continuing." ;; + *) echo >&4 "Okay, bye." + exit 2 + ;; + esac + eval "set X $args_exp"; + shift; + # Restore the output + exec Configure.cmd "$@" 1>&2 exit 2 fi - echo "!!!" >&2 - echo "!!! You did not patch ./Configure!" >&2 - echo "!!! I create Configure.cmd and patch it from ./os2/diff.configure." >&2 - echo "!!!" >&2 - echo "$gnupatch -b -p1 --output=Configure.cmd <./os2/diff.configure 2>&1 | tee 00_auto_patch" >&2 + cat <&2 +!!! +!!! You did not patch ./Configure! +!!! I can create Configure.cmd and patch it from ./os2/diff.configure with the command +!!! +!!! $gnupatch -b -p1 --output=Configure.cmd <./os2/diff.configure 2>&1 | tee 00_auto_patch +EOC + rp='Do you want to auto-patch Configure to Configure.cmd?' + dflt='y' + . UU/myread + case "$ans" in + [yY]) echo >&4 "Okay, continuing." ;; + *) echo >&4 "Okay, bye." + exit 2 + ;; + esac ($gnupatch -b -p1 --output=Configure.cmd <./os2/diff.configure 2>&1 | tee 00_auto_patch) >&2 - echo "!!!" >&2 - echo "!!! The report of patching is copied to 00_auto_patch." >&2 - echo "!!! Now you need to restart Configure.cmd with all the options" >&2 - echo "!!!" >&2 + cat <&2 +!!! +!!! The report of patching is copied to 00_auto_patch. +!!! Now we need to restart Configure.cmd with all the options. +!!! +EOC echo "extproc sh" > Configure.ctm - cat Configure.cmd >> Configure.ctm && mv -f Configure.ctm Configure.cmd - exit 0 + ( cat Configure.cmd >> Configure.ctm && mv -f Configure.ctm Configure.cmd ) || (echo "!!! Failure to add extproc-line to Configure.cmd." >&2 ; exit 21) + cat <&2 +!!! I went through incredible hoolahoops, and I expect I can +!!! auto-restart Configure.cmd myself. I will start it with arguments: +!!! +!!! Configure.cmd $args_exp +!!! +EOC + rp='Do you want to auto-restart Configure.cmd?' + dflt='y' + . UU/myread + case "$ans" in + [yY]) echo >&4 "Okay, continuing." ;; + *) echo >&4 "Okay, bye." + exit 2 + ;; + esac + eval "set X $args_exp"; + shift; + exec Configure.cmd "$@" 1>&2 + exit 2 else - echo "!!! Apparently we are running a patched Configure." >&2 + if test -s ./os2/diff.configure; then + echo "!!! Apparently we are running a patched Configure." >&2 + else + echo "!!! Apparently there is no need to patch Configure." >&2 + fi fi ;; *) echo "!!! Apparently we are running a renamed Configure: '$0'." >&2 @@ -335,6 +430,22 @@ $define|true|[yY]*) esac EOCBU +if test -z "$cryptlib"; then + cryptlib=`UU/loc crypt$lib_ext "" $libpth` + if $test -n "$cryptlib"; then + cryptlib=-lcrypt + else + cryptlib=`UU/loc ufc$lib_ext "" $libpth` + if $test -n "$cryptlib"; then + cryptlib=-lufc + fi + fi +fi +if test -n "$cryptlib"; then + libs="$libs $cryptlib" + # d_crypt=define +fi + # Now install the external modules. We are in the ./hints directory. cd ./os2/OS2 @@ -347,6 +458,7 @@ cp -rfu * ../../ext/OS2/ # Install tests: +cp -uf ../*.t ../../t/lib for xxx in * ; do if $test -d $xxx/t; then cp -uf $xxx/t/*.t ../../t/lib @@ -369,3 +481,4 @@ esac # Now go back cd ../.. +cp os2/*.t t/lib