Paul Eggert wrote: > the getlogin_r.m4 change (adding > AC_REQUIRE([AC_GNU_SOURCE])) looks a bit GNU-specific. Wouldn't it be > better to depend on the 'extensions' module instead? That would catch > similar problems in non-GNU systems. > > (Come to think of it, doesn't a similar argument apply to the 30 or so > other uses of AC_GNU_SOURCE in gnulib? I guess I can bring that up on > a different thread....)
Traditionally, we use AC_GNU_SOURCE to get declarations on glibc systems, and gl_USE_SYSTEM_EXTENSIONS to get declarations on glibc and Solaris systems. getlogin_r appears to have the same problem on Solaris as on glibc, says a look into <unistd.h>. So it's good to use gl_USE_SYSTEM_EXTENSIONS in this case. memmem(), on the other hand, is not defined in Solaris headers. It's a pure glibc invention. Checking whether to define __EXTENSIONS__ for using memmem() would be pointless. So IMO whether to use AC_GNU_SOURCE or 'extensions' needs to be decided on a case by case basis. Bruno
