[KinoSearch] c99

Peter Karman peter at peknet.com
Fri Jan 15 09:30:18 PST 2010


Marvin Humphrey wrote on 1/15/10 11:24 AM:
> On Fri, Jan 15, 2010 at 08:49:55AM -0800, Eric Howe wrote:
>> Is there some sort of _POSIX_SOURCE, _BSD_SOURCE, _XOPEN_SOURCE, ... macro
>> magic needed to make things behave? 
> 
> I had a peek inside /usr/include/dirent.h on CentOS 5.2 and DT_DIR only gets
> defined if "__BSD" is defined.  Apparently adding "-std=c99" turns that off.
> 
> We probably want to blindly add "-D_GNU_SOURCE" when compiling under GCC.
> 
>   http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
> 
> It should be harmless on non-glibc systems.
> 
>     http://mail.python.org/pipermail/python-dev/2000-July/005414.html
> 
>     Defining _GNU_SOURCE on non glibc platforms shouldn't hurt,
>     so I simply dropped the switch.
> 

ah, ok.

Just tested this patch and it worked:

Index: buildlib/KinoSearch/Build.pm
===================================================================
--- buildlib/KinoSearch/Build.pm	(revision 5692)
+++ buildlib/KinoSearch/Build.pm	(working copy)
@@ -76,6 +76,9 @@
          $gcc_version = $1;
          if ($extra_ccflags !~ m/-std=c99/) {
              $extra_ccflags .= "-std=c99 ";
+        }
+        if ($extra_ccflags !~ m/-D_GNU_SOURCE/) {
+            $extra_ccflags .= "-D_GNU_SOURCE ";
          }
      }



-- 
Peter Karman  .  http://peknet.com/  .  peter at peknet.com



More information about the kinosearch mailing list