Hi all,
With this command-line:
"fpmake --prefix=bla --baseistall=test"
paramstr(1) gives "--prefix=bla ". Thus with the trailing space. Is this a bug or a feature?
Joost

Mailing lists / fpc-devel / 2011-12
12 messages · 6 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi all,
With this command-line:
"fpmake --prefix=bla --baseistall=test"
paramstr(1) gives "--prefix=bla ". Thus with the trailing space. Is this a bug or a feature?
Joost
It's what the shell has passed on. The paramstr() code doesn't do any parsing on Linux. It returns the elements in argv[]
Michael.
Most of the time I'm indeed on Linux, but this case it was Windows. But I guess the same thing holds?
Joost.
AFAIK it's not the same as on Windows you have a "commandline string" which needs to be parsed by the application.
Regards,
Sven.
Most of the time I'm indeed on Linux, but this case it was Windows. But I guess the same…
this
Hi Jost,
I am completely unable to reproduce this...
on a windows machine!
Futhermore this behavior would break lots of code
including the compiler itself...
Maybe there is some special configuration you are working on that explains this strange behavior...
Which Windows OS version do you use?
Is it a Virtual machine?
What shell are you using?
Pierre Muller
In our previous episode, Pierre Free Pascal said:
something "--prefix=bla "
this I am completely unable to reproduce this... on a windows machine! Futhermore this…
What I did was this: 'make install PREFIX=c:\lazarus\fpc\2.7.1\' the trailing backslash is important...
Then make runs (among others) the following command: .\fpmake.exe install --localunitdir=../.. --globalunitdir=.. --os=win32 --cpu=i386 -o -Ur -o -Xs -o -O2 -o -n -o -FuC:/svn/fpc-trunk/rtl/units/i386-win32 -o -FuC:/svn/fpc-trunk/packages/hash/units/i386-win32 -o -FuC:/svn/fpc-trunk/packages/paszlib/units/i386-win32 -o -FuC:/svn/fpc-trunk/packages/fcl-process/units/i386-win32 -o -FuC:/svn/fpc-trunk/packages/fpmkunit/units/i386-win32 -o -FE. -o -FUunits/i386-win32 -o -di386 -o -dRELEASE --compiler=C:/svn/fpc-trunk/compiler/ppc386.exe --prefix=c:\lazarus\fpc\2.7.1\ --unitinstalldir=c:\lazarus\fpc\2.7.1\/units/i386-win32/fcl-base -ie -d
Note the two spaces after the prefix. Which result in the error message that the directory "c:\lazarus\fpc\2.7.1 \bin" coudn't be created. (Note the space)
Can you reproduce that? I tried with a simple hello-world kind of application and in that case I can't reproduce it either.
This is on Windows 7 in a virtual machine. (kvm)
Joost.
23.12.2011 1:26, Joost van der Sluis пишет:
Just some notes:
- syswin.inc code looks like any number of delimiters between parameters are skipped.
- this extra whitespace is added by the makefile, suggesting some buggy/incorrect processing in make.exe or makefile itself.
- the extra character may be not a whitespace (#32), but something looking like one (e.g. non-breaking space with code #160)
Sergei
In our previous episode, Sergei Gorelkin said:
.. unless quoted.
- this extra whitespace is added by the makefile, suggesting some buggy/incorrect processing in make.exe or makefile itself.
It could be that the makefile logic quotes every argument on windows, in case of spaces. We would need a kind of strace tool for Windows to find out.
23.12.2011 16:18, Marco van de Voort пишет:
... it is the trailing backslash escaping the following character (C style). I could reproduce the issue, by using the following command in 'packages' directory:
make install PP=f:\trunk\compiler\ppc386.exe PREFIX="f:\lazarus\fpc\2.7.1\"
Note the quotes, and also note where they end up in output:
make -C fcl-base install
make[1]: Entering directory `F:/trunk/packages/fcl-base' .\fpmake.exe install --localunitdir=../.. --globalunitdir=.. --os=win32 --cpu=i386 -o -Fu../../rtl/units/i386-win32 -o -Fu../../packages/hash/units/i386-win32 -o -Fu../../packages/paszlib/units/i386-win32 -o -Fu../../packages/fcl-process/units/i386-win32 -o -Fu../../packages/fpmkunit/units/i386-win32 -o -FE. -o -FUunits/i386-win32 -o -di386 --compiler=f:/trunk/compiler/ppc386.exe --prefix=f:\lazarus\fpc\2.7.1" --unitinstalldir=f:\lazarus\fpc\2.7.1"/units/i386-win32/fcl-base The installer encountered the following error:
Failed to create directory "f:\lazarus\fpc\2.7.1
--unitinstalldir=f:\lazarus\fpc\2.7.1\units\i386-win32\fcl-base\units\i386-win32\fcl-base\" make[1]: *** [install] Error 1
Without quotes the result is basically the same:
.\fpmake.exe install --localunitdir=../.. --globalunitdir=.. --os=win32 --cpu=i386 -o -Fu../../rtl/units/i386-win32 -o -Fu../../packages/hash/units/i386-win32 -o -Fu../../packages/paszlib/units/i386-win32 -o -Fu../../packages/fcl-process/units/i386-win32 -o -Fu../../packages/fpmkunit/units/i386-win32 -o -FE. -o -FUunits/i386-win32 -o -di386 --compiler=f:/trunk/compiler/ppc386.exe --prefix=f:\lazarus\fpc\2.7.1\ --unitinstalldir=f:\lazarus\fpc\2.7.1\/units/i386-win32/fcl-base The installer encountered the following error:
Failed to create directory "f:\lazarus\fpc\2.7.1
--unitinstalldir=f:\lazarus\fpc\2.7.1\\units\i386-win32\fcl-base\units\i386-win32\fcl-base\"
Finally, when trailing backslash is duplicated, everything runs successfully.
Sergei
So to conclude, it's a problem of make that it handles the backslash as if it were a escaping-backslash. There's nothing that we have to change, except that fpmake has to trim it's input values to handle this buggy make-behavior.
Joost.
I don't think that its buggy behavior,
windows make, be it cygwin, mingw32 (and probably also msys) do expect only forward slashes for directory separators and always handles backward slashes as escapes.
Using forward slashes for all parameters of a make call should avoid the problem...
If you really wanted backward slashes, then, simply use escaped backslashes, i.e. two in a row,
make install PREFIX=c:\\lazarus\\fpc\\2.7.1\\
Pierre