[core] only use feature test macros on linux

personal/stbuehler/wip
Stefan Bühler 9 years ago
parent 42ce5eda8f
commit e762189fb5
  1. 12
      include/lighttpd/settings.h
  2. 1
      src/CMakeLists.txt
  3. 2
      wscript

@ -32,9 +32,15 @@
# warning "unknown OS, please report this"
#endif
#define _XOPEN_SOURCE 600
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
/* FreeBSD doesn't export special stuff if any feature test macro is set */
#ifdef LIGHTY_OS_LINUX
# define _XOPEN_SOURCE 600
# ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
# endif
# ifndef _BSD_SOURCE
# define _BSD_SOURCE 1
# endif
#endif
#ifdef HAVE_CONFIG_H

@ -415,7 +415,6 @@ IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} -O2")
ADD_DEFINITIONS(-D_GNU_SOURCE)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
SET_TARGET_PROPERTIES(lighttpd2-worker PROPERTIES CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

@ -60,7 +60,7 @@ def configure(conf):
conf.env['CCFLAGS'] = tolist(conf.env['CCFLAGS'])
conf.env['CCFLAGS'] += [
'-std=gnu99', '-Wall', '-Wshadow', '-W', '-pedantic', '-fPIC',
'-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_LARGE_FILES',
'-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_LARGE_FILES',
'-g', '-g2'
# '-fno-strict-aliasing',
]

Loading…
Cancel
Save