i370 port - constructing compile script
Paul Edwards
mutazilah@gmail.com
Thu Nov 12 20:56:00 GMT 2009
> * Paul Edwards wrote on Thu, Nov 12, 2009 at 03:02:59PM CET:
>> Well, I have good news to report. The restructuring was a success.
>>
>> That means with those 30-odd changes to the configure scripts, I
>> was able to get an auto-host.h built that allowed me to take the
>> generated source and compile it with my own scripts as per
>> normal.
>
> It would be a good idea if you took the extra mile and reported all
> these changes to the bug-autoconf mailing list, so it could be fixed
> for good there.
I was under the impression that the root cause was a problem
with configure.ac in gcc rather than autoconf. However, I took
a look at that file, and I can only see a couple of references
to sys/types.h, none of which look the same as the sort of
thing I needed to change.
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
+ #if !defined(__MVS__)
#include <sys/types.h>
#include <sys/stat.h>
+ #endif
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include "confdefs.h"
+ #if !defined(__MVS__)
#include <sys/types.h>
+ #endif
> Furthermore, it would be really good if we could get Autoconf to build
> and run on your system, so you could run its test suite there. That
> would provide much better coverage of all the issues that would need
> fixing, and allow us to fix them once in the macros, instead of having
> you do this repeatedly in every configure script.
I am running on a Linux box! The thing I am doing that is unusual
is two things:
1. Only providing C90 headers when cross-building a host. That
means that things like sys/types are failing.
2. No linking is done, because I don't have a cross-linker.
As far as I can tell, peculiarity number 2 has not caused the need
for any changes, with the possible exception of ones like this:
+ #if !defined(__MVS__)
#include <sys/types.h>
#include <sys/param.h>
+ #endif
+ #if defined(__MVS__)
+ #define BIG_ENDIAN 1
+ #define LITTLE_ENDIAN 2
+ #define BYTE_ORDER 1
+ #endif
I'm not sure what that one was all about, and I'm not sure the
result of it is even used.
Note that peculiarity 2 ideally requires prototypes for all
functions, so there were a couple of other changes made to the
gcc 3.4.6 code, such as this one:
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
! #if defined (HAVE_DECL_GETRUSAGE) && !HAVE_DECL_GETRUSAGE
extern int getrusage (int, struct rusage *);
#endif
--- 86,100 ----
#include "prefix.h"
#include "gcc.h"
#include "flags.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
! #if defined (HAVE_GETRUSAGE) && !HAVE_DECL_GETRUSAGE
extern int getrusage (int, struct rusage *);
#endif
Anyway, all of this should be reproducible building any ASCII
target on any ASCII machine, just by using a C90 set of head
files and a dummy compile script like this:
C:\devel\gccnew\gcc\config\i370>type i370-mvspdp-gcc
echo $* >>/tmp/build.txt
i370-mvspdp-xxx -Werror-implicit-function-declaration -DPUREISO -S -I
/devel/mvshead/usr/include $*
Note the '-S' which could be '-c' instead and the -W.
> However, Autoconf requires Perl and GNU M4 (and some shell environment
> as well as a make program), so I'm not sure whether it is possible to
> get to this point.
Those are all available on the build machine, even though, out of those,
only m4 is available on the host. :-)
BFN. Paul.
More information about the Gcc
mailing list