unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Portability Question
@ 2020-05-20  3:19 Evan Klitzke
  2020-05-20 11:29 ` Stefan Monnier
  2020-05-20 14:28 ` Eli Zaretskii
  0 siblings, 2 replies; 3+ messages in thread
From: Evan Klitzke @ 2020-05-20  3:19 UTC (permalink / raw)
  To: Emacs-devel

I am (hopefully) a new Emacs contributor and I started working on some 
changes to Emacs that I would like to contribute as patches, and I have 
some questions about writing platform specific code in Emacs. I'm adding 
new code in sysdep.c and want to know the best practices.

The first question I have is which standard POSIX headers it's safe to 
assume are available. The reason I ask this is that sysdep.c already 
includes <unistd.h> without a HAVE_UNISTD_H check, which implies to me 
that there's already a requirement on having POSIX headers available 
(i.e. I assume on Windows Cygwin is required to build?). But, somewhat 
confusingly, when sysdep.c includes <pwd.h> it uses a HAVE_PWD_H guard, 
even though this is a standard POSIX header.

Another question I have is: in practice, which build configurations for 
Emacs are likely to link against glibc vs another libc (e.g. I see there 
are a number of checks to see if __UCLIBC__ is defined, so at a minimum 
that's a possibility). For example, do the various macos builds (e.g. 
emacsformacosx.com and homebrew) typically use glibc or the macos system 
libc? And same question for Windows. The reason I'm asking is if I 
opportunistically want to use a glibc extension and fallback to 
something that works but is hacky if glibc isn't available, I'm 
wondering in practice which build configurations will have to use the 
hacky fallback path.

Thanks much.

P.S. I need to sign an FSF copyright assignment agreement (as an 
individual contributor). Can someone send me the necessary documents?

--
Evan Klitzke                      pgp: 0x157EFCACBC648422
e: evan@eklitzke.org              w: https://eklitzke.org



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Portability Question
  2020-05-20  3:19 Portability Question Evan Klitzke
@ 2020-05-20 11:29 ` Stefan Monnier
  2020-05-20 14:28 ` Eli Zaretskii
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2020-05-20 11:29 UTC (permalink / raw)
  To: Evan Klitzke; +Cc: Emacs-devel

> The first question I have is which standard POSIX headers it's safe to
> assume are available.

I'll let others reply, but a large part of the answer is that we use
`gnulib` to deal with many of those issues.

> P.S. I need to sign an FSF copyright assignment agreement (as an individual
> contributor). Can someone send me the necessary documents?

Sent off-list,


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Portability Question
  2020-05-20  3:19 Portability Question Evan Klitzke
  2020-05-20 11:29 ` Stefan Monnier
@ 2020-05-20 14:28 ` Eli Zaretskii
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2020-05-20 14:28 UTC (permalink / raw)
  To: Evan Klitzke; +Cc: Emacs-devel

> From: Evan Klitzke <evan@eklitzke.org>
> Date: Tue, 19 May 2020 20:19:38 -0700
> 
> I am (hopefully) a new Emacs contributor and I started working on some 
> changes to Emacs that I would like to contribute as patches, and I have 
> some questions about writing platform specific code in Emacs. I'm adding 
> new code in sysdep.c and want to know the best practices.

Thank you for working on Emacs development.

Please note that sysdep.c is not the only place for platform-dependent
code, it depends on what the proposed code will do.  If you are
unsure, please feel free to ask more questions.

> The first question I have is which standard POSIX headers it's safe to 
> assume are available. The reason I ask this is that sysdep.c already 
> includes <unistd.h> without a HAVE_UNISTD_H check, which implies to me 
> that there's already a requirement on having POSIX headers available 
> (i.e. I assume on Windows Cygwin is required to build?). But, somewhat 
> confusingly, when sysdep.c includes <pwd.h> it uses a HAVE_PWD_H guard, 
> even though this is a standard POSIX header.

My advice is not to be bothered by that too much.  Use your best
judgment, and we will tell you if some changes are needed when we
review the patches.

> Another question I have is: in practice, which build configurations for 
> Emacs are likely to link against glibc vs another libc

In general, only GNU/Linux platforms use glibc.

> The reason I'm asking is if I opportunistically want to use a glibc
> extension and fallback to something that works but is hacky if glibc
> isn't available, I'm wondering in practice which build
> configurations will have to use the hacky fallback path.

Features that are not necessarily available outside of glibc should
either require some Gnulib module to replace them, or need fallback
code activated by configure-time test.

Thanks.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-20 14:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  3:19 Portability Question Evan Klitzke
2020-05-20 11:29 ` Stefan Monnier
2020-05-20 14:28 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).