> cat > foo.c << EOF > #include <sys/types.h> > EOF > > if (eval "cc -E foo.c" 2>/dev/null) | egrep "ulong[a-zA-Z_0-9]" > /dev/null > 2>&1 ; then > echo yes ulong is found under sys/types.h > else > echo no ulong is not found under sys/types.h > fi > > It *should* say 'yes', but I bet it says no. If it doessay no, then its > running the compile test which, sans sys/types.h, should fail, and hence > the > #define is stuck in there. If it is saying 'yes', then we should ask why > its either incorrectly testing ac_cv_type_ulong and running the compile > test or, I suppose, testing it correctly there and incorrectly later, when > its determining whether to stick the #define into confdefs.h. > > So, I'm betting it says no and that there's some odd property of either the > preprocessor or egrep on your system. > > Greg >
Well, well, here's what happens: Greg, your code above works. The "yes ulong is found" message appears. When I replace it with the following code: if (eval "$ac_cpp foo.c" 2>/dev/null) | egrep "ulong[a-zA-Z_0-9]" > /dev/null The code fails (no ulong found). $ac_cpp is defined as /lib/cpp in this case. When I setenv CPP "cc -E" as Peter has suggested, it works again! The man page for cpp warns against using it standalone. I guess they know something they're not saying. My problems are not quite over, however. Now I'm getting complaints from array.c about unint, ulong NOT being defined. The file includes string.h. Funny thing is than "strings.h" does include sys/types.h, "string.h" does not. Looks like strings.h is some kind of wrapper for string.h. I'm checking into it. Richard
