Discussion:
owcc and path separators.
(too old to reply)
Dave Yeo
2012-09-20 22:13:40 UTC
Permalink
Raw Message
Should owcc support using / as a path separator (OS/2). I recently tried
it on a hand written configure script which use %TMP%, r:\tmp here, to
write its test files and it failed due to using r:/tmp/xxxxx.o for
temporary files. Seems most posix systems use / and even much of OS/2
doesn't care much about whether using \ or /.
Dave
Hans-Bernhard Bröker
2012-09-21 16:45:11 UTC
Permalink
Raw Message
Post by Dave Yeo
Should owcc support using / as a path separator (OS/2).
To some extent. Getting the MS platform-based tools to recognize / as a
non-option character is kind of tricky though.
Post by Dave Yeo
I recently tried it on a hand written configure script which use
%TMP%, r:\tmp here, to write its test files and it failed due to
using r:/tmp/xxxxx.o for temporary files.
That description doesn't really tell us what exactly you did, nor how
exactly it failed. Please try to compose a minimal, yet complete
example case: the exact command line to owcc (with the -v flag active if
at all possible), and its actual output.
Hans-Bernhard Bröker
2012-09-21 18:37:43 UTC
Permalink
Raw Message
Post by Hans-Bernhard Bröker
Post by Dave Yeo
Should owcc support using / as a path separator (OS/2).
To some extent. Getting the MS platform-based tools to recognize / as a
non-option character is kind of tricky though.
On closer inspection of the source: no, it's not trying to do that.
owcc expects file names in the host OS's native format (c:\dir\file.ext
on MS platforms, /root/dir/file.ext on Unix-type ones)
Dave Yeo
2012-09-22 03:11:51 UTC
Permalink
Raw Message
Post by Dave Yeo
Should owcc support using / as a path separator (OS/2).
To some extent. Getting the MS platform-based tools to recognize / as a
non-option character is kind of tricky though.
On closer inspection of the source: no, it's not trying to do that. owcc
expects file names in the host OS's native format (c:\dir\file.ext on MS
platforms, /root/dir/file.ext on Unix-type ones)
I'll have to download the source and look at it. Seems to me that owcc
should be agnostic about path separators, much like GCC and many other
programs on OS/2. Of course cmd.exe and friends do treat / as an option
character. (many other programs use -, -- and/or / for options)
Dave
Dave Yeo
2012-09-22 03:06:31 UTC
Permalink
Raw Message
Post by Dave Yeo
Should owcc support using / as a path separator (OS/2).
To some extent. Getting the MS platform-based tools to recognize / as a
non-option character is kind of tricky though.
It's a Posix compiler, it should be working in a Posix environment. At least that's how I'm attempting to use it on OS/2. Cp instead of copy, rm instead of del etc with all the tools handling bourne type options such as - or --. Enforced by %SHELL%, %MAKESHELL% and such being set to [pdk]sh.exe.
Post by Dave Yeo
I recently tried it on a hand written configure script which use
%TMP%, r:\tmp here, to write its test files and it failed due to
using r:/tmp/xxxxx.o for temporary files.
That description doesn't really tell us what exactly you did, nor how
exactly it failed. Please try to compose a minimal, yet complete example
case: the exact command line to owcc (with the -v flag active if at all
possible), and its actual output.
Strangely today it does not actually fail running configure --cc="owcc -v". Here's part of config.log
WARNING: Unknown C compiler owcc -v, unable to select optimal CFLAGS
check_ld
check_cc
BEGIN R:/tmp/ffconf.RAPmsJZc.c
1 int main(void){ return 0; }
END R:/tmp/ffconf.RAPmsJZc.c
owcc -v -c -o R:/tmp/ffconf.YoDFrgco.o R:/tmp/ffconf.RAPmsJZc.c
Open Watcom C/C++ Compiler Driver Program Version 1.9
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wcc386 R:ffconf.RAPmsJZc.c -fo=R:\tmp\ffconf.YoDFrgco.o -fr
Open Watcom C32 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
R:ffconf.RAPmsJZc.c: 1 lines, included 35, 0 warnings, 0 errors
Code size: 13

Running [gnu]make after results in this error,

owcc -v -I. -I. -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DHAVE_AV_CONFIG_H -MM libavfilter/af_aformat.c | sed -e "/^#.*/d" -e "s,^[[:space:]]*af_aformat\\.o,libavfilter/af_aformat.o," > libavfilter/af_aformat.d
owcc -v -I. -I. -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DHAVE_AV_CONFIG_H -std=c99 -fomit-frame-pointer -g -Wall -fno-math-errno -fno-signed-zeros -c -o libavfilter/af_aformat.o libavfilter/af_aformat.c
Open Watcom C/C++ Compiler Driver Program Version 1.9
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wcc386 af_aformat.c -I. -I. -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DHAVE_AV_CONFIG_H -za99 -d2 -w4 -fo=libavfilter\af_aformat.o -fr
Open Watcom C32 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
Error! Unable to open 'af_aformat.c'
Error: Compiler returned a bad status compiling "af_aformat.c"

with af_aformat.d containing a similar error.
Other then the path separator issue owcc seems to do a good job of translating to wc386.
Dave
ps the project is libav, fork of FFmpeg.
Hans-Bernhard Bröker
2012-09-22 14:34:03 UTC
Permalink
Raw Message
Post by Dave Yeo
Post by Dave Yeo
Should owcc support using / as a path separator (OS/2).
To some extent. Getting the MS platform-based tools to recognize / as a
non-option character is kind of tricky though.
It's a Posix compiler, it should be working in a Posix environment.
But that doesn't change the fact that neither Windows nor OS/2 actually
is a Posix environment. If owcc enforced POSIX pathname syntax, it
would be impossible to use drive letters.
Post by Dave Yeo
Strangely today it does not actually fail running configure --cc="owcc -v". Here's part of config.log
owcc -v -c -o R:/tmp/ffconf.YoDFrgco.o R:/tmp/ffconf.RAPmsJZc.c
Open Watcom C/C++ Compiler Driver Program Version 1.9
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wcc386 R:ffconf.RAPmsJZc.c -fo=R:\tmp\ffconf.YoDFrgco.o -fr
^^^^^^^^^^^^^^^^^^^
Here's the problem. The /tmp/ part was dropped, because it didn't look
like a platform-style path component to cc\wcl\c\clcommon.c:MakePath()
Dave Yeo
2013-05-15 04:15:50 UTC
Permalink
Raw Message
Post by Hans-Bernhard Bröker
Post by Dave Yeo
Post by Dave Yeo
Should owcc support using / as a path separator (OS/2).
To some extent. Getting the MS platform-based tools to recognize / as a
non-option character is kind of tricky though.
It's a Posix compiler, it should be working in a Posix environment.
But that doesn't change the fact that neither Windows nor OS/2 actually
is a Posix environment. If owcc enforced POSIX pathname syntax, it would
be impossible to use drive letters.
X:/path/to/whatever, x:/path\to/whatever, x:\path/to\whatever all work
with GCC and quite a few of standard OS/2 calls. I've even created
program objects on the desktop with mixed path separators.
Post by Hans-Bernhard Bröker
Post by Dave Yeo
Strangely today it does not actually fail running configure --cc="owcc
-v". Here's part of config.log
owcc -v -c -o R:/tmp/ffconf.YoDFrgco.o R:/tmp/ffconf.RAPmsJZc.c
Open Watcom C/C++ Compiler Driver Program Version 1.9
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wcc386 R:ffconf.RAPmsJZc.c -fo=R:\tmp\ffconf.YoDFrgco.o -fr
^^^^^^^^^^^^^^^^^^^
Here's the problem. The /tmp/ part was dropped, because it didn't look
like a platform-style path component to cc\wcl\c\clcommon.c:MakePath()
It is nice and simple to be able to do set CC=owcc && set LD=owcc &&
set AR=emxomfar && set RANLIB=echo && sh ./configure --disable-shared &&
make and have configure correctly figure out owcc capabilities and build
a working project. This does work until make invokes a pathname with a
slash as a directory separator without getting an error such as
Error! Unable to open 'compat.c'
Error: Compiler returned a bad status compiling "compat.c"
due to source='foo/compat.c'
Dave

Loading...