Forum: CFEngine Help Subject: Re: CFEngine Help: Re: Cannot compile cfengine-3.2.0.tar.gz on Solaris 10 Author: Beto Link to topic: https://cfengine.com/forum/read.php?3,23163,23366#msg-23366
> On 09/02/2011 06:34 PM, no-re...@cfengine.com > wrote: > So it compiles, but does not link due to missing > dirfd. Please add the > following lines to pub/dirfd.c and try again: > > #if defined(__hpux) || defined(_AIX) > int dirfd(DIR *dirp) > { > return dirp->dd_fd != -1 ? dirp->dd_fd : ENOTSUP; > } > #endif > > Hence, the question is how to distinguish real gcc > and cc -Agcc. > With the pub/dirfd.c change: . . . cc: warning 901: unknown option: `-fPIC': use +help for online documentation. "dirfd.c", line 27: error #2020: identifier "DIR" is undefined int dirfd(DIR *dirp) ^ "dirfd.c", line 29: error #2132: expression must have pointer-to-struct-or-union type return dirp->dd_fd != -1 ? dirp->dd_fd : ENOTSUP; ^ "dirfd.c", line 29: error #2132: expression must have pointer-to-struct-or-union type return dirp->dd_fd != -1 ? dirp->dd_fd : ENOTSUP; ^ "dirfd.c", line 29: error #2020: identifier "ENOTSUP" is undefined return dirp->dd_fd != -1 ? dirp->dd_fd : ENOTSUP; ^ 4 errors detected in the compilation of "dirfd.c". > Could you try to compile and show the output of > the following program > (using cc -Agcc)? > > #include > > int main() > { > #if defined __HP_cc > printf("HP ANSI C\n"); > #endif > } This produces: wilma:/home/root# aCC -Agcc test_hp_cc.C wilma:/home/root# ./a.out HP ANSI C _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine