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

(-)portage-2.0.50_pre20/src/sandbox-1.1/Makefile (-7 / +27 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
ifneq ($(HAVE_64BIT_ARCH),)
27
 TARGETS = libsandbox.so libsandbox32.so sandbox
28
 ARCH_CFLAGS += -m64
29
 OBJ_CFLAGS +=  -DSB_HAVE_64BIT_ARCH
30
else
31
 TARGETS = libsandbox.so sandbox
32
endif
24
33
25
all:	$(TARGETS)
34
all:	$(TARGETS)
26
35
27
sandbox: sandbox.o sandbox_futils.o getcwd.c
36
sandbox: sandbox.o sandbox_futils.o getcwd.c
28
	$(CC) $^ -ldl -lc -o $@
37
	$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(OBJ_CFLAGS) -Wall $^ -ldl -lc -o $@
29
38
30
sandbox.o: sandbox.c sandbox.h
39
sandbox.o: sandbox.c sandbox.h
31
	$(CC) $(CFLAGS) -Wall -c sandbox.c
40
	$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(OBJ_CFLAGS) -Wall -c sandbox.c -o $@
32
41
33
sandbox_futils.o: sandbox_futils.c sandbox.h
42
sandbox_futils.o: sandbox_futils.c sandbox.h
34
	$(CC) $(CFLAGS) -Wall -c $(OBJ_DEFINES) sandbox_futils.c
43
	$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(OBJ_CFLAGS) -Wall -c sandbox_futils.c -o $@
35
44
36
libsandbox.so: libsandbox.o sandbox_futils.o
45
libsandbox.so: libsandbox.o sandbox_futils.o
37
	$(CC) $^ -shared -fPIC -ldl -lc -o $@ -nostdlib -lgcc
46
	$(CC) $^ -shared $(ARCH_CFLAGS) -fPIC -ldl -lc -nostdlib -lgcc -o $@
38
47
39
libsandbox.o: libsandbox.c localdecls.h canonicalize.c getcwd.c
48
libsandbox.o: libsandbox.c localdecls.h canonicalize.c getcwd.c
40
	$(CC) $(CFLAGS) -Wall -c $(OBJ_DEFINES) libsandbox.c
49
	$(CC) $(CFLAGS) $(ARCH_CFLAGS) $(OBJ_CFLAGS) -Wall -c libsandbox.c
50
51
sandbox_futils32.o: sandbox_futils.c sandbox.h
52
	$(CC) $(CFLAGS) -m32 $(OBJ_CFLAGS) -Wall -c sandbox_futils.c -o $@
53
54
libsandbox32.so: libsandbox32.o sandbox_futils32.o
55
	$(CC) $^ -shared -m32 -fPIC -ldl -lc -nostdlib -lgcc -o $@
56
57
libsandbox32.o: libsandbox.c localdecls.h canonicalize.c getcwd.c
58
	$(CC) $(CFLAGS) -m32 $(OBJ_CFLAGS) -Wall -c libsandbox.c -o $@
41
59
42
localdecls.h: create-localdecls libctest.c
60
localdecls.h: create-localdecls libctest.c
43
	./create-localdecls
61
	./create-localdecls
Lines 45-53 Link Here
45
63
46
install: all
64
install: all
47
	install -d -m 0755 $(DESTDIR)/lib
65
	install -d -m 0755 $(DESTDIR)/lib
66
	$(if $(HAVE_64BIT_ARCH),install -d -m 0755 $(DESTDIR)/lib32)
48
	install -d -m 0755 $(DESTDIR)/usr/lib/portage/bin
67
	install -d -m 0755 $(DESTDIR)/usr/lib/portage/bin
49
	install -d -m 0755 $(DESTDIR)/usr/lib/portage/lib
68
	install -d -m 0755 $(DESTDIR)/usr/lib/portage/lib
50
	install -m 0755 libsandbox.so $(DESTDIR)/lib
69
	install -m 0755 libsandbox.so $(DESTDIR)/lib
70
	$(if $(HAVE_64BIT_ARCH),install -m 0755 libsandbox32.so $(DESTDIR)/lib32/libsandbox.so)
51
	install -m 0755 sandbox $(DESTDIR)/usr/lib/portage/bin
71
	install -m 0755 sandbox $(DESTDIR)/usr/lib/portage/bin
52
	install -m 0644 sandbox.bashrc $(DESTDIR)/usr/lib/portage/lib
72
	install -m 0644 sandbox.bashrc $(DESTDIR)/usr/lib/portage/lib
53
73
(-)portage-2.0.50_pre20/src/sandbox-1.1/sandbox.c (-2 / +5 lines)
Lines 14-20 Link Here
14
**  $Header: /home/cvsroot/gentoo-src/portage/src/sandbox-1.1/sandbox.c,v 1.13 2004/01/12 21:11:46 carpaski Exp $
14
**  $Header: /home/cvsroot/gentoo-src/portage/src/sandbox-1.1/sandbox.c,v 1.13 2004/01/12 21:11:46 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>
Lines 585-595 Link Here
585
		if (print_debug)
585
		if (print_debug)
586
			printf("Verification of the required files.\n");
586
			printf("Verification of the required files.\n");
587
587
588
#ifndef SB_HAVE_64BIT_ARCH
588
		if (file_exist(sandbox_lib, 0) <= 0) {
589
		if (file_exist(sandbox_lib, 0) <= 0) {
589
			fprintf(stderr, "Could not open the sandbox library at '%s'.\n",
590
			fprintf(stderr, "Could not open the sandbox library at '%s'.\n",
590
							sandbox_lib);
591
							sandbox_lib);
591
			return -1;
592
			return -1;
592
		} else if (file_exist(sandbox_rc, 0) <= 0) {
593
		} 
594
#endif
595
		if (file_exist(sandbox_rc, 0) <= 0) {
593
			fprintf(stderr, "Could not open the sandbox rc file at '%s'.\n",
596
			fprintf(stderr, "Could not open the sandbox rc file at '%s'.\n",
594
							sandbox_rc);
597
							sandbox_rc);
595
			return -1;
598
			return -1;
(-)portage-2.0.50_pre20/src/sandbox-1.1/sandbox_futils.c (+4 lines)
Lines 57-66 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