3 # The converted script is written to stdout, so run this script as
4 # convert_configure configure > configure.cmd
6 # When the converted script runs, it expects that /tmp dir is
7 # available (so we create it).
9 # run the result like this:
12 # Some frequent manual intervention:
13 # a) Some makefiles hardwire SHELL = /bin/sh ==> change to: sh
14 # b) Some makefiles recognize that exe files terminate on .exe
15 # You need to give this script -no-zexe option...
17 shift, $no_zexe = 1 if @ARGV and $ARGV[0] eq '-no-zexe';
19 mkdir '/tmp', 0777 unless -d
'/tmp';
26 print <<EOF unless $no_zexe;
27 # Make sensible defaults:
32 #GCCOPT="$GCCOPT -Zexe"
40 # Optimization (GNU make 3.74 cannot be loaded :-():
41 emxload -m 30 sh.exe ls.exe tr.exe id.exe sed.exe # make.exe
42 emxload -m 30 grep.exe egrep.exe fgrep.exe cat.exe rm.exe mv.exe cp.exe
43 emxload -m 30 uniq.exe basename.exe sort.exe awk.exe echo.exe
51 if (/for\s+(\w+)\s+in\s*\$(PATH|ac_dummy)\s*;/) {
55 $varname="`echo -E \\"\$$varname\\" | tr \\\\\\\\\\\\\\\\ / `"
58 if (/if\s+test\s+-z\s+\"\$INSTALL\"/) {
59 $checking_install = 1;
61 $checking_install = $checking_path = 0 if /^\s*done\s*$/;
62 # We want to create an extra line like this one:
63 # ac_dir="`echo -E \"$ac_dir\" | tr \\\\\\\\ / `"
64 s
{^((\s
*)if\s
+test
)\s
*-f\s
*(\
$$varname/\S
+)\s
*;}
65 {$2$subst$1 -f
$3 -o
-f
$3.exe
;}
66 if $checking_path; # Checking for executables
67 # change |/usr/sbin/*| to |/usr/sbin/*|?:[\\/]os2[\\/]install[\\/]*|
68 # in the list of things to skip (with both cases)
70 {|/usr/sbin
/*|?:[\\\\/]os2
[\\\\/]install[\\\\/]*|?
:[\\\\/]OS2[\\\\/]INSTALL
[\\\\/]*|}
71 if $checking_install; # Do not accept d:/os2/install/install.exe
72 s/^(host|build)=NONE$/$1=x86-emx-os2/; # Make default host/build
73 s/"\$\{IFS}:"$/"\${IFS};"/; # Fix IFS line
74 s/\bIFS=\":\"$/IFS=";"/; # Fix another IFS line
75 s/\btest\s+-s\s+conftest\b/test -f conftest/g; # Fix exe test
76 # This one is needed for curses:
77 s/^\s*host=`.*\$ac_config_sub \$host_alias`/$&\nif test -z "\$host"; then host=\$host_alias; fi/;
78 s
,/bin/sh
(?
![/\w
]),sh
,g
;
79 s
,^(\s
*/usr/sbin
/sendmail\s*)\\$,$1 "`whence sendmail | tr '\\\\\\\\' / `" \\,;
85 Changes: 98/11 : support check for executables in ncurses.
86 99/2 : support INSTALL,
89 00/01 : export CONFIG_SHELL
90 00/10 : new syntax for host=`...` line