04.02.2015, 01:58, "Frank Terbeck" <[email protected]>: > Hey there! > > ZyX wrote: > [...] >> To use zsh headers in some module at least `config.h` file is needed > > Finally, someone who actually wants to use zsh's facilities to load > third party modules. Yay. ;) >> in addition to those already present in the package. `config.h` files >> contains defines guessed by ./configure script and including it prior >> to `zsh.h` is the only sane variant to include `zsh.h` (insane variant >> is using module’s own configure script which will create those >> defines). Without `config.h` including `zsh.h` will fail due to >> missing defines, and even if it was not failing it would make #include >> <zsh.h> do the wrong thing because of the bits like > > [...] > > I agree. >> (configure.h-driven definition of zlong and zulong which has the potential >> of breaking ABI compatibility in some cases). >> >> In addition to this file it is good to have a patched `zsh.mdh` file >> which glues together all zsh includes and is a single entry point. >> Patch needed to include this file in the distribution may be performed >> with the following script: >> >> for file in Src/{zsh.mdh,*.h} ; do > > We'd probably want to do that in a POSIX compatible way, so we'd refrain > from using brace expansion but that's just cosmetics. >> sed -i 's@\.\./config\[email protected]@' "$file" >> sed -i 's@#\(\s*\)include "\([^"]\+\)"@#\1include >> <zsh/\2>@' "$file" > > Sed's -i option requires GNU sed. But then, I don't know if debian even > ships another version of sed. ...I think it doesn't; but I also don't > know about the policy with respect to non-POSIX features in packaging. >> done >> >> . I am doing this in a Gentoo ebuild and the result works just fine. > > Yeah, I think this could work. > > Do you think it would make sense to include the other header files with > zsh-dev as well? Like "zshterm.h" etc?
In my ebuild I am simply doins all *.h files from Src, passed throught these filters, so zshterm.h gets caught as well. But I think that all of them are #included by zsh.mdh, at least zshterm.h does (zsh.mdh includes zsh_system.h and that includes zshterm.h). Did not know you do not do the same thing (I mean, adding Src/*.h). > > Regards, Frank -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

