Yes it is. However, you can come up with other examples where this is not
the case. Consider developing a driver and I want to make sure it compiles
on the alpha, sparc, x86, ppc, and mips platforms. It would be a real pain
to do that now.
> Since the configuration scripts are already divided up by subsystem
> anyway, why not take the next logical step and create an autoconf.h-type
> file for each subsystem? We could do this in three steps:
This is an excellent idea, and I think it is something that needs to be
done. I don't see it as a replacement for what I was talking about though,
more of something else which needs to be improved.
> I'm willing to start working on this if enough people think it's worth the
> effort. Of course I'd like Linus's blessing on this too since it's going
> to eventually involve patching pretty much every file in the source tree.
>
> I'd be interested in anyone's thoughts on exactly how the configuration
> data should be divided. My first instinct is to create a config header for
> every place there is a Config.in file. Comments?
I worked on something like this once, but as I said above I ran out of
time. I think some other people did too. Fortunatly we talked to Linus
enough to know what he would bless. His main concern was that if there
is a place in the kernel source where something like:
#ifdef CONFIG_XYZ
#endif
appeared, there needs to be an automatic way to make sure that whatever
file should define CONFIG_XYZ is included. Its too easy to leave them out
otherwise. It would probably be possible to put a check like this in the
make_dep program, but I never worked that out.
At the time I was working on this, I made a seperate include file for each
CONFIG option. Its trivial to hack up the configuration script to do this.
Something I though of the other day that may make things prettier is to have
a static file like the current autoconfig.h, which contains lines like:
#ifdef NEED_CONFIG_XYZ
# include <autoconfg/config_xyz.h>
#endif
Then your source would look like this:
#define NEED_CONFIG_XYZ
#define NEED_CONFIG_ABC
#include <newautoconfg.h>
#ifdef CONFIG_XYZ
#endif
#ifndef CONFIG_ABC
#endif
I'm not sure this is any better, but its a different way to do it.
One problem with doing this is that many header files contain macros which
are looking at the CONFIG_ variables. This probably needs to be rearranged,
but thats going to be a mess. One problem I had when I was working on the
Makefiles is that I don't know how a lot of the kernel code works, and I
don't have the means to test a lot of it. I hate to assume that if I change
something and it still compiles that I have not broken anything.
Anyway those are my thoughts. If you can get somethink like you proposed to
work, you will make a lot of people very happy.
Jim