diff options
author | Lauri Leukkunen <lle@rahina.org> | 2007-11-20 01:47:04 +0200 |
---|---|---|
committer | Lauri Leukkunen <lle@rahina.org> | 2007-11-20 01:47:04 +0200 |
commit | e1626dad47e0d14652966cb597edfd020c94bc86 (patch) | |
tree | f0e5c46fec8f0be442f69117892517beb868d6ca | |
parent | 055cb965bf570257b6549ed9715bf7cd188a5d3c (diff) |
Fix compilation on linux
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | luaif/luaif.c | 2 | ||||
-rw-r--r-- | luaif/paths.c | 2 | ||||
-rw-r--r-- | luaif/sb_log.c | 2 | ||||
-rw-r--r-- | preload/Makefile | 4 | ||||
-rw-r--r-- | preload/libsb2.c | 3 | ||||
-rw-r--r-- | preload/libsb2.h | 7 | ||||
-rw-r--r-- | preload/sb_exec.c | 2 | ||||
-rw-r--r-- | utils/sb_gcc_wrapper.cc | 2 |
10 files changed, 8 insertions, 20 deletions
@@ -38,7 +38,7 @@ subdirs = luaif preload utils CFLAGS += -O2 -g -Wall -W CFLAGS += -I$(OBJDIR)/include -I$(SRCDIR)/include CFLAGS += -I$(SRCDIR)/luaif/lua-5.1.2/src -CFLAGS += -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 +CFLAGS += -D_GNU_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 CFLAGS += -DSCRATCHBOX_ROOT="$(prefix)" CXXFLAGS = diff --git a/configure.ac b/configure.ac index f6a2573..4db15f5 100644 --- a/configure.ac +++ b/configure.ac @@ -172,7 +172,7 @@ AH_TEMPLATE([SUPPORT_XATTRS], [Define to 1 to add support for extended attributes]) case "$(uname -s)" in -*linux*) +*Linux*) AC_MSG_RESULT(Using Linux xattrs) AC_DEFINE(HAVE_LINUX_XATTRS, 1, [True if you have Linux xattrs]) AC_DEFINE(SUPPORT_XATTRS, 1) diff --git a/luaif/luaif.c b/luaif/luaif.c index 26f51b8..c581858 100644 --- a/luaif/luaif.c +++ b/luaif/luaif.c @@ -4,8 +4,6 @@ * Licensed under LGPL version 2.1, see top level LICENSE file for details. */ -#define _GNU_SOURCE - #include <unistd.h> #include <stdio.h> #include <stdlib.h> diff --git a/luaif/paths.c b/luaif/paths.c index 6ca0239..861fb41 100644 --- a/luaif/paths.c +++ b/luaif/paths.c @@ -4,8 +4,6 @@ * Licensed under LGPL version 2.1, see top level LICENSE file for details. */ -#define _GNU_SOURCE - #include <unistd.h> #include <stdio.h> #include <stdlib.h> diff --git a/luaif/sb_log.c b/luaif/sb_log.c index a24e74b..89e3eec 100644 --- a/luaif/sb_log.c +++ b/luaif/sb_log.c @@ -5,8 +5,6 @@ * Licensed under LGPL version 2.1, see top level LICENSE file for details. */ -#define _GNU_SOURCE - #include <stdlib.h> #include <stdarg.h> #include <stdio.h> diff --git a/preload/Makefile b/preload/Makefile index 8a34a6a..5518d53 100644 --- a/preload/Makefile +++ b/preload/Makefile @@ -7,10 +7,10 @@ ifeq ($(shell uname -s),Linux) LIBSB2_LDFLAGS = -Wl,-soname=$(LIBSB2_SONAME) \ -Wl,--retain-symbols-file=preload/ldexportlist LIBSB2_LIBS = -lrt -SHLIBEXT = dylib +SHLIBEXT = so else #LIBSB2_LDFLAGS = -dynamiclib -SHLIBEXT = so +SHLIBEXT = dylib endif diff --git a/preload/libsb2.c b/preload/libsb2.c index dd70f0a..97570a7 100644 --- a/preload/libsb2.c +++ b/preload/libsb2.c @@ -28,10 +28,11 @@ */ #include <unistd.h> +#include <config.h> +#include <config_hardcoded.h> #include "libsb2.h" #include "exported.h" - /* strchrnul(): Find the first occurrence of C in S or the final NUL byte. * This is not present on all systems, so we'll use our own version in sb2. */ diff --git a/preload/libsb2.h b/preload/libsb2.h index 023550b..7476144 100644 --- a/preload/libsb2.h +++ b/preload/libsb2.h @@ -32,7 +32,6 @@ #include "config.h" #include "config_hardcoded.h" -#define _GNU_SOURCE #define __BSD_VISIBLE #include <assert.h> @@ -121,11 +120,7 @@ } - -#ifndef __GLIBC__ -extern char **environ; -#endif - extern void *sbox_find_next_symbol(int log_enabled, const char *functname); #endif /* ifndef LIBSB2_H_INCLUDED_ */ + diff --git a/preload/sb_exec.c b/preload/sb_exec.c index 6bd9e9e..aeacd8f 100644 --- a/preload/sb_exec.c +++ b/preload/sb_exec.c @@ -4,8 +4,6 @@ * Licensed under LGPL version 2.1 */ -#define _GNU_SOURCE - #include <string.h> #include <stdlib.h> #include <stdio.h> diff --git a/utils/sb_gcc_wrapper.cc b/utils/sb_gcc_wrapper.cc index aa08ba9..da8ecb5 100644 --- a/utils/sb_gcc_wrapper.cc +++ b/utils/sb_gcc_wrapper.cc @@ -203,7 +203,7 @@ static Program *detect_program(const char *const name, const Group group) static const Program &detect_program(const char *const absname) { // GNU basename never modifies its argument - const char *const name = basename(absname); + const char *const name = basename((char *)absname); const Program *prog; if ((prog = detect_program(name, compilers)) || |