summaryrefslogtreecommitdiff
path: root/emulators/dynamips/patches/patch-aa
blob: 63b4e7593593d6746cbbbf5c550b14217f42f62b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
$NetBSD: patch-aa,v 1.2 2008/06/03 13:53:49 kefren Exp $
--- Makefile.orig	2007-05-26 12:52:33 +0300
+++ Makefile	2008-06-02 18:40:41 +0300
@@ -3,7 +3,19 @@
 
 # Replace x86 by amd64 for a build on x86_64.
 # Use "nojit" for architectures that are not x86 or x86_64.
-DYNAMIPS_ARCH?=x86
+ifeq ($(shell uname -m), i386)
+   DYNAMIPS_ARCH?=x86
+else
+ifeq ($(shell uname -m), i686)
+   DYNAMIPS_ARCH?=x86
+else
+ifeq ($(shell uname -m), amd64)
+   DYNAMIPS_ARCH?=amd64
+else
+   DYNAMIPS_ARCH?=nojit
+endif
+endif
+endif
 
 # Change this to 0 if your system doesn't support RFC 2553 extensions
 HAS_RFC2553?=1
@@ -40,8 +52,8 @@ CFLAGS+=-g -Wall -O3 -fomit-frame-pointe
 	-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
 	-DHAS_RFC2553=$(HAS_RFC2553)
 
-PCAP_LIB=/usr/local/lib/libpcap.a
-#PCAP_LIB=-lpcap
+#PCAP_LIB=/usr/local/lib/libpcap.a
+PCAP_LIB=-lpcap
 
 ifeq ($(shell uname), FreeBSD)
    PTHREAD_LIBS?=-pthread
@@ -49,6 +61,16 @@ ifeq ($(shell uname), FreeBSD)
          -D_FILE_OFFSET_BITS=64
    LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)
 else
+ifeq ($(shell uname -s), NetBSD)
+	PTHREAD_LIBS?=-pthread
+	CFLAGS+=-I${LOCALBASE}/include -I${LOCALBASE}/include/libelf ${PTHREAD_CFLAGS}
+	LIBS=-L${LOCALBASE}/lib -lelf ${PTHREAD_LIBS} ${PTHREAD_LDFLAGS} -R${LOCALBASE}/lib
+else
+ifeq ($(shell uname -s), DragonFly)
+	PTHREAD_LIBS?=-pthread
+	CFLAGS+=-I${LOCALBASE}/include -I${LOCALBASE}/include/libelf ${PTHREAD_CFLAGS}
+	LIBS=-L${LOCALBASE}/lib -lelf ${PTHREAD_LIBS} ${PTHREAD_LDFLAGS} -R${LOCALBASE}/lib
+else
 ifeq ($(shell uname), Linux)
    PTHREAD_LIBS?=-lpthread
 #   PCAP_LIB=-lpcap
@@ -80,6 +102,8 @@ endif
 endif
 endif
 endif
+endif
+endif
 
 PROG=dynamips$(BIN_EXT)
 PACKAGE=$(PROG)-$(VERSION)