Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 32963 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-7 / +38 lines)
Lines 15-43 Link Here
15
CC = gcc
15
CC = gcc
16
LD = ld
16
LD = ld
17
CFLAGS =
17
CFLAGS =
18
OBJ_DEFINES = -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT
18
ARCH_CFLAGS =
19
OBJ_CFLAGS = -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT
19
LIBS =
20
LIBS =
20
LDFLAGS =
21
LDFLAGS =
21
DESTDIR =
22
DESTDIR =
22
23
23
TARGETS = libsandbox.so sandbox
24
HAVE_64BIT_ARCH =
25
26
HAVE_64BIT_FS = $(shell ls -ld $(ROOT)/lib32 2>/dev/null)
27
ifneq ($(HAVE_64BIT_FS),)
28
 HAVE_32BIT_GCC = $(shell $(CC) -m32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && echo "yes")
29
 ifneq ($(HAVE_32BIT_GCC),)
30
  HAVE_64BIT_GCC = $(shell $(CC) -m64 -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && echo "yes")
31
  ifneq ($(HAVE_64BIT_GCC),)
32
   HAVE_64BIT_ARCH = yes
33
  endif
34
 endif
35
endif
36
       
37
ifneq ($(HAVE_64BIT_ARCH),)
38
 TARGETS = libsandbox.so libsandbox32.so sandbox
39
 ARCH_CFLAGS += -m64
40
 OBJ_CFLAGS +=  -DSB_HAVE_64BIT_ARCH
41
else
42
 TARGETS = libsandbox.so sandbox
43
endif
24
44
25
all:	$(TARGETS)
45
all:	$(TARGETS)
26
46
27
sandbox: sandbox.o sandbox_futils.o getcwd.c
47
sandbox: sandbox.o sandbox_futils.o getcwd.c
28
	$(CC) $^ -ldl -lc -o $@
48
	$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(OBJ_CFLAGS) -Wall $^ -ldl -lc -o $@
29
49
30
sandbox.o: sandbox.c sandbox.h
50
sandbox.o: sandbox.c sandbox.h
31
	$(CC) $(CFLAGS) -Wall -c sandbox.c
51
	$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(OBJ_CFLAGS) -Wall -c sandbox.c -o $@
32
52
33
sandbox_futils.o: sandbox_futils.c sandbox.h
53
sandbox_futils.o: sandbox_futils.c sandbox.h
34
	$(CC) $(CFLAGS) -Wall -c $(OBJ_DEFINES) sandbox_futils.c
54
	$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(OBJ_CFLAGS) -Wall -c sandbox_futils.c -o $@
35
55
36
libsandbox.so: libsandbox.o sandbox_futils.o
56
libsandbox.so: libsandbox.o sandbox_futils.o
37
	$(CC) $^ -shared -fPIC -ldl -lc -o $@ -nostdlib -lgcc
57
	$(CC) $^ -shared $(ARCH_CFLAGS) -fPIC -ldl -lc -nostdlib -lgcc -o $@
38
58
39
libsandbox.o: libsandbox.c localdecls.h canonicalize.c getcwd.c
59
libsandbox.o: libsandbox.c localdecls.h canonicalize.c getcwd.c
40
	$(CC) $(CFLAGS) -Wall -c $(OBJ_DEFINES) libsandbox.c
60
	$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(OBJ_CFLAGS) -Wall -c libsandbox.c
61
62
sandbox_futils32.o: sandbox_futils.c sandbox.h
63
	$(CC) $(CFLAGS) -m32 $(OBJ_CFLAGS) -Wall -c sandbox_futils.c -o $@
64
65
libsandbox32.so: libsandbox32.o sandbox_futils32.o
66
	$(CC) $^ -shared -m32 -fPIC -ldl -lc -nostdlib -lgcc -o $@
67
68
libsandbox32.o: libsandbox.c localdecls.h canonicalize.c getcwd.c
69
	$(CC) $(CFLAGS) -m32 $(OBJ_CFLAGS) -Wall -c libsandbox.c -o $@
41
70
42
localdecls.h: create-localdecls libctest.c
71
localdecls.h: create-localdecls libctest.c
43
	./create-localdecls
72
	./create-localdecls
Lines 45-53 localdecls.h: create-localdecls libctest Link Here
45
74
46
install: all
75
install: all
47
	install -d -m 0755 $(DESTDIR)/lib
76
	install -d -m 0755 $(DESTDIR)/lib
77
	$(if $(HAVE_64BIT_ARCH),install -d -m 0755 $(DESTDIR)/lib32)
48
	install -d -m 0755 $(DESTDIR)/usr/lib/portage/bin
78
	install -d -m 0755 $(DESTDIR)/usr/lib/portage/bin
49
	install -d -m 0755 $(DESTDIR)/usr/lib/portage/lib
79
	install -d -m 0755 $(DESTDIR)/usr/lib/portage/lib
50
	install -m 0755 libsandbox.so $(DESTDIR)/lib
80
	install -m 0755 libsandbox.so $(DESTDIR)/lib
81
	$(if $(HAVE_64BIT_ARCH),install -m 0755 libsandbox32.so $(DESTDIR)/lib32/libsandbox.so)
51
	install -m 0755 sandbox $(DESTDIR)/usr/lib/portage/bin
82
	install -m 0755 sandbox $(DESTDIR)/usr/lib/portage/bin
52
	install -m 0644 sandbox.bashrc $(DESTDIR)/usr/lib/portage/lib
83
	install -m 0644 sandbox.bashrc $(DESTDIR)/usr/lib/portage/lib
53
84
(-)sandbox.c (-1 / +1 lines)
Lines 14-20 Link Here
14
**  $Header: /home/cvsroot/gentoo-src/portage/src/sandbox-1.1/sandbox.c,v 1.12 2003/10/12 22:36:58 carpaski Exp $
14
**  $Header: /home/cvsroot/gentoo-src/portage/src/sandbox-1.1/sandbox.c,v 1.12 2003/10/12 22:36:58 carpaski Exp $
15
*/
15
*/
16
16
17
#define _GNU_SOURCE
17
/* #define _GNU_SOURCE */
18
18
19
#include <errno.h>
19
#include <errno.h>
20
#include <fcntl.h>
20
#include <fcntl.h>
(-)sandbox_futils.c (+4 lines)
Lines 57-66 get_sandbox_lib(char *sb_path) Link Here
57
{
57
{
58
	char path[255];
58
	char path[255];
59
59
60
#ifdef SB_HAVE_64BIT_ARCH
61
        snprintf(path, 254, "%s", LIB_NAME);
62
#else
60
	snprintf(path, 254, "/lib/%s", LIB_NAME);
63
	snprintf(path, 254, "/lib/%s", LIB_NAME);
61
	if (file_exist(path, 0) <= 0) {
64
	if (file_exist(path, 0) <= 0) {
62
		snprintf(path, 254, "%s%s", sb_path, LIB_NAME);
65
		snprintf(path, 254, "%s%s", sb_path, LIB_NAME);
63
	}
66
	}
67
#endif
64
	return (strdup(path));
68
	return (strdup(path));
65
}
69
}
66
70

Return to bug 32963