git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: patches

From
Jason Riedy <ejr@eecs.berkeley.edu>
Date
Sep 9, 2005, 22:25 UTC
Message-ID
<25968.1126304722@lotus.CS.Berkeley.EDU>
In-Reply-To
<1125962642.15293.20.camel@divert>
And Patrick Mauritz writes:
 - 
 - --- git-core-0.99.5.orig/convert-cache.c	Wed Aug 17 09:55:00 2005
 - +++ git-core-0.99.5/convert-cache.c	Wed Aug 17 09:58:48 2005
 - @@ -1,4 +1,5 @@
 -  #define _XOPEN_SOURCE /* glibc2 needs this */
 - +#define __EXTENSIONS__ /* solaris needs this */

To be honest, the right place to handle both these #defines is the Makefile. AIX needs its own set of -Ds to turn on various standards. ugh. I'm sure HP-UX needs even more magic, IRIX needs (is?) a dead chicken, etc.

 - +#ifndef __sun
[...]
 -  		getdomainname(real_email+len, sizeof(real_email)-len);
[...]
 - +#endif

getdomainname isn't declared, but it is in libnsl (on Solaris 8, Sparc) and works just fine. Sun documents sysinfo (2) as its replacement, but that call is different on different platforms. I'd be shocked if getdomainname disappeared from libnsl, especially since the C++ include files declare it. Whoops.

 - +ifeq ($(shell uname -s),SunOS)
 - +  LIBS += -lsocket
 - +endif

Traditionally, it's -lsocket -lnsl to cover all the bases. Old SunOS4 -> SunOS5 porting annoyance. That also lets getdomainname work.

The Makefile is generally insufficient for any platform other than Linux with system-supplied support libraries. Fixing that will take a good deal of work and probably will involve putting a bunch of variable-defining makefile fragments somewhere and including the "right" one. With the right variable definitions, a user can over-ride any of them from the make command...

In the meantime, my personal coping method is just to copy the Makefile to Makefile.platform, edit it, and use make -f Makefile.platform. I could be really cool and just use a different git branch per platform, but I'm lazy.

Jason
Previous: Patrick MauritzNext: Junio C Hamano
Message 4 of 5 in “patches”
  1. Patrick MauritzSep 5, 2005
  2. Junio C HamanoSep 8, 2005
  3. Patrick MauritzSep 8, 2005
  4. Jason RiedySep 9, 2005
  5. getdomainname should be usable on SunOS with -lnslJunio C Hamano, Sep 12, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.