Peter Gerwinski once wrote:
The normal procedure is to type first `./configure' and then `make LANGUAGES=pascal' in the GCC directory that contains the GPC source in a subdirectory `p'. However I know that mingw32 needs special care.
Like I said before, I can't do anything with "configure" under Win32. The system simply fails to recognise the script as something that it can execute. This is so even when trying to run the script under Bash. Since this script seems really to be a unix thing, perhaps an alternative could be made for non-unix systems? - basically, either to translate the "configure" script into batch commands that the Dos or Windows command interpreters can process (which is probably impossible, because the script seems too complex to translate into a Dos batch file) or to write a Pascal (or C) program that does everything that the "configure" script does. I would do this myself (i.e., translate into a Pascal program) if I understood the script - but I don't (at least, not most of it).
Does this seem a feasible option, or am I barking up the wrong tree here? If it is feasible, does anyone wish to take up the task?
PS: Perhaps I can get bash to run the script. If I try to run "configure.in", bash seems to start trying to run it, and then finally chokes. However, with "configure", it just says that the file does not exist - which is not true. Doing "ls -all config*" shows that the attributes of "configure.in" are "-rw-r--r--", while those of "configure" are "-rwxr-xr-x". Is the difference significant? If so, what parameters do I pass to "chmod" so as to change the attributes of "configure" to the same one as "configure.in"?
Thanks.
Best regards, The Chief -------- Dr. Abimbola A. Olowofoyeku (The African Chief) Email: laa12@keele.ac.uk Homepage: http://ourworld.compuserve.com/homepages/African_Chief/ Author of: Chief's Installer Pro v5.20a for Win32 ftp://ftp.demon.co.uk/pub/ibmpc/win95/apps/chief32/chief52a.zip
The African Chief wrote:
Like I said before, I can't do anything with "configure" under Win32. The system simply fails to recognise the script as something that it can execute.
Maybe the script expects a program "\bin\sh.exe" because the first line reads "#!/bin/sh". This problem once occured under DJGPP ...
This is so even when trying to run the script under Bash. Since this script seems really to be a unix thing, perhaps an alternative could be made for non-unix systems? - basically, either to translate the "configure" script into batch commands that the Dos or Windows command interpreters can process (which is probably impossible, because the script seems too complex to translate into a Dos batch file) or to write a Pascal (or C) program that does everything that the "configure" script does. [...]
The second thing would be possible but unwise: The script is generated automatically and re-built with each version of GCC.
The right solution would be to make `mingw32' complete enough to run the script (as has been done for DJGPP). Besides `bash', the "text utils" and "shell utils" are needed (see DJGPP).
What I did in fact do for EMX where I also could not run the `configure' script was to generate `Makefile', `p/Makefile', `p/rts/Makefile' and (IIRC) some `*config*.h' files manually (by manually changing the corresponding `*.in' files while looking what `configure' had done before for Linux). The same can certainly be done for mingw32 - of course with the drawback that the work has to be repeated each time the underlying GCC version changes.
(Nevertheless it can be an interesting exercise to do this work now for gcc-2.8.1 or egcs-1.1.2 and repeat it in a few days/weeks when GPC can run with gcc-2.95.x.;-)
PS: Perhaps I can get bash to run the script. If I try to run "configure.in", bash seems to start trying to run it, and then finally chokes. However, with "configure", it just says that the file does not exist - which is not true. Doing "ls -all config*" shows that the attributes of "configure.in" are "-rw-r--r--", while those of "configure" are "-rwxr-xr-x". Is the difference significant?
Yes - `x' means "eXecutable".
If so, what parameters do I pass to "chmod" so as to change the attributes of "configure" to the same one as "configure.in"?
chmod +x configure.in
But it will not run.
Greetings,
Peter
On 10 Sep 99, at 9:44, Peter Gerwinski peter@gerwinski.de wrote:
The African Chief wrote:
Like I said before, I can't do anything with "configure" under Win32. The system simply fails to recognise the script as something that it can execute.
Maybe the script expects a program "\bin\sh.exe" because the first line reads "#!/bin/sh". This problem once occured under DJGPP ...
"sh.exe" exists, but not in "/bin". The /bin stuff is a unix thing (who has ever heard of "/bin" under any other OS?). I amended it to remove the "/bin" prefix so that "sh" gets executed. However, this does not help.
This is so even when trying to run the script under Bash. Since this script seems really to be a unix thing, perhaps an alternative could be made for non-unix systems? - basically, either to translate the "configure" script into batch commands that the Dos or Windows command interpreters can process (which is probably impossible, because the script seems too complex to translate into a Dos batch file) or to write a Pascal (or C) program that does everything that the "configure" script does. [...]
The second thing would be possible but unwise: The script is generated automatically and re-built with each version of GCC.
Hmmm ... can the same thing that generates this script also generate a C program to do the same thing? Surely the GCC guys care about non-unix platforms?
The right solution would be to make `mingw32' complete enough to run the script (as has been done for DJGPP). Besides `bash', the "text utils" and "shell utils" are needed (see DJGPP).
AFAICS all these utilities exist for Cygwin32 (they all seem to be there in my Cygwin32 directory tree). Mingw32 can use the Cygwin32 tools alright. It is only the libraries that are different. Personally, I would be happy if I could compile GPC for either Cygwin32 or Mingw32. The only real difference is a large DLL that Cygwin32 programs require (to implement the unix emulation layer for Windows).
In any case, the problem here is more fundamental than these. The configure script itself cannot even be recognised as something that can be executed. If that first hurdle can be crossed, then one can begin to worry about the remaining utils.
What I did in fact do for EMX where I also could not run the `configure' script was to generate `Makefile', `p/Makefile', `p/rts/Makefile' and (IIRC) some `*config*.h' files manually (by manually changing the corresponding `*.in' files while looking what `configure' had done before for Linux). The same can certainly be done for mingw32 - of course with the drawback that the work has to be repeated each time the underlying GCC version changes.
In which case, would it be easier to write a program to do the job?
(Nevertheless it can be an interesting exercise to do this work now for gcc-2.8.1 or egcs-1.1.2 and repeat it in a few days/weeks when GPC can run with gcc-2.95.x.;-)
Perhaps the GCC guys can try to minimise the changes (or even optionally to generate a C program instead of (or in addition to) the script?). I guess they might not be too concerned with Pascal, or with non-unix people, to bother too much about all this.
PS: Perhaps I can get bash to run the script. If I try to run "configure.in", bash seems to start trying to run it, and then finally chokes. However, with "configure", it just says that the file does not exist - which is not true. Doing "ls -all config*" shows that the attributes of "configure.in" are "-rw-r--r--", while those of "configure" are "-rwxr-xr-x". Is the difference significant?
Yes - `x' means "eXecutable".
If so, what parameters do I pass to "chmod" so as to change the attributes of "configure" to the same one as "configure.in"?
chmod +x configure.in
But it will not run.
The problem is the other way round. Bash tries (without success) to run "configure.in", but claims that "configure" does not exist. So, it seems to recognise "configure.in" as something that can be executed, despite the fact that the "x" is not in its attributes.
All this is giving me a headache. Perhaps I should just stick with Law .... :-/
Best regards, The Chief --------------- Dr Abimbola Olowofoyeku (The African Chief) Author of Chief's Installer Pro v5.20a for Win32 ftp://ftp.simtel.net/pub/simtelnet/win95/install/chief52a.zip Email: laa12@keele.ac.uk http://ourworld.compuserve.com/homepages/African_Chief/
10-Sep-99 10:57 you wrote:
Peter Gerwinski once wrote:
The normal procedure is to type first `./configure' and then `make LANGUAGES=pascal' in the GCC directory that contains the GPC source in a subdirectory `p'. However I know that mingw32 needs special care.
Like I said before, I can't do anything with "configure" under Win32. The system simply fails to recognise the script as something that it can execute. This is so even when trying to run the script under Bash. Since this script seems really to be a unix thing, perhaps an alternative could be made for non-unix systems? - basically, either to translate the "configure" script into batch commands that the Dos or Windows command interpreters can process (which is probably impossible, because the script seems too complex to translate into a Dos batch file) or to write a Pascal (or C) program that does everything that the "configure" script does. I would do this myself (i.e., translate into a Pascal program) if I understood the script - but I don't (at least, not most of it).
configure is created from configure.in in not-trivial preprocessing and I think that it's far better to try and find out why you can not execure it with bash then try to convert in in something compatible with Win32. It SHOULD work in cygwin environment.
Does this seem a feasible option, or am I barking up the wrong tree here? If it is feasible, does anyone wish to take up the task?
This is way to complex task to even think about it. Better try to find out why you can not execute script.
PS: Perhaps I can get bash to run the script. If I try to run "configure.in", bash seems to start trying to run it, and then finally chokes.
Since you should not execute configure.in ...
However, with "configure", it just says that the file does not exist - which is not true.
I bet it's true :-)
Doing "ls -all config*" shows that the attributes of "configure.in" are "-rw-r--r--", while those of "configure" are "-rwxr-xr-x". Is the difference significant?
Yes. "x" is "executable" bit. So in normal (unix-like OS) you can execute configure but not configure.in ... Execute with just "./configure" command taht is.
If so, what parameters do I pass to "chmod" so as to change the attributes of "configure" to the same one as "configure.in"?
chmod a-x
And then configure will not be executable (just like configure.in is now).
Are you shure you have bash accessible as /bin/sh ? Since configure starts with "#!/bin/sh" cygwin will try to execute it with /bin/sh and if it's not there you'll see "file does not exist" message. I bet it's exactly what happens...
Doing "ls -all config*" shows that the attributes of "configure.in" are "-rw-r--r--", while those of "configure" are "-rwxr-xr-x". Is the difference significant?
Yes. "x" is "executable" bit. So in normal (unix-like OS) you can execute configure but not configure.in ... Execute with just "./configure" command taht is.
To be sure, in DJGPP you have two ways to "run configure"
- first way: first boot bash from dos prompt (e.g. >), by typing e.g.
bash -login
when you have the bash prompt (e.g. $) you type $ ./configure --prefix=c:/djgpp
-second way directly from dos prompt type simply:
bash configure --prefix=c:/djgpp
Both methods work. --prefix is mandatory because the default is /usr/local which does not exist under DOS. What are you doing exactly?
On the other hand you need to create sh.exe from bash.exe In djgpp you have two ways
copy bash.exe sh.exe
or make a symlink
ln -s bash.exe sh.exe
the second is more economical because it creates only a short file (2048 bytes) which calls bash, but both work. In djgpp bash translates silently
/bin/sh
to
%DJDIR%/bin/sh
i.e. for example
c:/djgpp/bin/sh
I don't know what it does under mingw32, but this is certainly crucial.
Any how you could try to circumvent it by putting sh.exe in a dir /bin directly at root of your disk.
Hi all
Thanks to all who responded. I have had *some* success by following some of the tips. For posterity, what I have done to have any success is as follows:
1. create directory: /bin 2. copy bash.exe to /bin 3. copy sh.exe to /bin 4. copy ld.exe to same directory as collect2.exe 5. run bash 6. type "./configure" (with or without '--prefix=c:/cygnus') 7. type "make LANGUAGES=pascal"
Okay, so what succeeded? Bash succeeded in running "./configure". All sorts of things start appearing on my screen, including the fact that these files were not found; 1.glob.h 2.fnmatch.h 3.sys/statvfs.h
That did not seem to affect things though. The thing finishes running, and has created a number of files (including config.log and rts- config.h). I run "make", and some things happen, and then it chokes on 'file.c', at line:1665. It claims that there are too few arguments to 'mkdir', in the function '_p_mkdir'. In the meantime, 'read.o', 'write.o', and 'rts.o' have been created.
I can't seem to locate where 'mkdir' is defined in the Cygwin headers, but I did find a reference to it in one header file, which seems to suggest that it takes 3 parameters, instead of 2.
That is my report. I am not sure where to go from here.
PS: I guess that I am now trying to compile for Cygwin instead of Mingw32.
Best regards, The Chief -------- Dr. Abimbola A. Olowofoyeku (The African Chief) Email: laa12@keele.ac.uk Homepage: http://ourworld.compuserve.com/homepages/African_Chief/ Author of: Chief's Installer Pro v5.20a for Win32 ftp://ftp.demon.co.uk/pub/ibmpc/win95/apps/chief32/chief52a.zip