Fix aiccu compilation on MacOSX (#2303)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@12274 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
fe0f273564
commit
89e7d958e6
@ -34,9 +34,9 @@ endef
|
|||||||
|
|
||||||
define Build/Compile
|
define Build/Compile
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||||
CC="$(TARGET_CC)" \
|
CC="$(TARGET_CC)" OS_NAME="Linux" OS_VERSION="$(LINUX_VERSION)" \
|
||||||
CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -DAICCU_CONSOLE -DHAS_IFHEAD -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
|
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -lpthread" \
|
EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -pthread" \
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -1,38 +1,38 @@
|
|||||||
diff -urN aiccu/unix-console/Makefile aiccu.new/unix-console/Makefile
|
--- aiccu/unix-console/Makefile.orig 2007-09-02 23:19:39.000000000 +0200
|
||||||
--- aiccu/unix-console/Makefile 2007-01-15 12:04:27.000000000 +0100
|
+++ aiccu/unix-console/Makefile 2007-09-02 23:20:11.000000000 +0200
|
||||||
+++ aiccu.new/unix-console/Makefile 2007-01-18 15:08:28.000000000 +0100
|
@@ -25,7 +25,8 @@
|
||||||
@@ -10,6 +10,9 @@
|
# CWARNS += -Wpacked
|
||||||
# $Date: 2007-01-15 11:04:27 $
|
|
||||||
# **********************************************************/
|
|
||||||
|
|
||||||
+OS_NAME=$(shell uname)
|
#CFLAGS += $(CWARNS) -D_GNU_SOURCE -D_DEBUG -g3 -O0
|
||||||
+OS_VERSION=$(shell uname -r)
|
-CFLAGS += $(CWARNS) -D_GNU_SOURCE
|
||||||
+
|
+CFLAGS += $(CWARNS) $(EXTRA_CFLAGS) -D_GNU_SOURCE
|
||||||
SRCS = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c
|
+LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
INCS = ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h
|
CC = @gcc
|
||||||
OBJS = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o
|
RM = rm
|
||||||
@@ -40,13 +43,13 @@
|
|
||||||
|
@@ -40,25 +41,25 @@
|
||||||
# GnuTLS Support ?
|
# GnuTLS Support ?
|
||||||
# Used by TIC to secure that communication
|
# Used by TIC to secure that communication
|
||||||
# Currently defaultly builds only on Linux, but other platforms might easily also support it
|
# Currently defaultly builds only on Linux, but other platforms might easily also support it
|
||||||
-ifeq ($(shell uname | grep -c "Linux"),1)
|
-ifeq ($(shell uname | grep -c "Linux"),1)
|
||||||
+ifneq ($(HAEVE_GNUTLS),)
|
+ifneq ($(HAVE_GNUTLS),)
|
||||||
CFLAGS += -D AICCU_GNUTLS
|
CFLAGS += -D AICCU_GNUTLS
|
||||||
LDFLAGS += -lgnutls
|
LDFLAGS += -lgnutls
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Linux
|
# Linux
|
||||||
-ifeq ($(shell uname | grep -c "Linux"),1)
|
-ifeq ($(shell uname | grep -c "Linux"),1)
|
||||||
+ifeq ($(shell echo $(OS_NAME) | grep -c "Linux"),1)
|
+ifeq ($(OS_NAME),Linux)
|
||||||
CFLAGS += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\""
|
CFLAGS += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\""
|
||||||
SRCS += ../common/aiccu_linux.c
|
SRCS += ../common/aiccu_linux.c
|
||||||
OBJS += ../common/aiccu_linux.o
|
OBJS += ../common/aiccu_linux.o
|
||||||
@@ -54,11 +57,11 @@
|
-LDFLAGS += -lpthread -lresolv
|
||||||
|
+LDFLAGS += -pthread -lresolv
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# FreeBSD
|
# FreeBSD
|
||||||
-ifeq ($(shell uname | grep -c "FreeBSD"),1)
|
-ifeq ($(shell uname | grep -c "FreeBSD"),1)
|
||||||
+ifeq ($(shell echo $(OS_NAME) | grep -c "FreeBSD"),1)
|
+ifeq ($(OS_NAME),FreeBSD)
|
||||||
CFLAGS += -D_FREEBSD
|
CFLAGS += -D_FREEBSD
|
||||||
|
|
||||||
# FreeBSD 4.x
|
# FreeBSD 4.x
|
||||||
@ -41,30 +41,30 @@ diff -urN aiccu/unix-console/Makefile aiccu.new/unix-console/Makefile
|
|||||||
CFLAGS += -D AICCU_TYPE="\"freebsd4\""
|
CFLAGS += -D AICCU_TYPE="\"freebsd4\""
|
||||||
SRCS += ../common/aiccu_freebsd4.c
|
SRCS += ../common/aiccu_freebsd4.c
|
||||||
OBJS += ../common/aiccu_freebsd4.o
|
OBJS += ../common/aiccu_freebsd4.o
|
||||||
@@ -71,7 +74,7 @@
|
@@ -71,7 +72,7 @@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# DragonFlyBSD
|
# DragonFlyBSD
|
||||||
-ifeq ($(shell uname | grep -c "DragonFly"),1)
|
-ifeq ($(shell uname | grep -c "DragonFly"),1)
|
||||||
+ifeq ($(shell echo $(OS_NAME) | grep -c "DragonFly"),1)
|
+ifeq ($(OS_NAME),DragonFly)
|
||||||
CFLAGS += -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\""
|
CFLAGS += -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\""
|
||||||
SRCS += ../common/aiccu_freebsd4.c
|
SRCS += ../common/aiccu_freebsd4.c
|
||||||
OBJS += ../common/aiccu_freebsd4.o
|
OBJS += ../common/aiccu_freebsd4.o
|
||||||
@@ -79,7 +82,7 @@
|
@@ -79,7 +80,7 @@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# NetBSD
|
# NetBSD
|
||||||
-ifeq ($(shell uname | grep -c "NetBSD"),1)
|
-ifeq ($(shell uname | grep -c "NetBSD"),1)
|
||||||
+ifeq ($(shell echo $(OS_NAME) | grep -c "NetBSD"),1)
|
+ifeq ($(OS_NAME),NetBSD)
|
||||||
CFLAGS += -D_NETBSD -D AICCU_TYPE="\"kame\""
|
CFLAGS += -D_NETBSD -D AICCU_TYPE="\"kame\""
|
||||||
|
|
||||||
# Check if net/if_tun.h has TUNSIFHEAD and enable support for it
|
# Check if net/if_tun.h has TUNSIFHEAD and enable support for it
|
||||||
@@ -97,10 +100,10 @@
|
@@ -97,10 +98,10 @@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OpenBSD
|
# OpenBSD
|
||||||
-ifeq ($(shell uname | grep -c "OpenBSD"),1)
|
-ifeq ($(shell uname | grep -c "OpenBSD"),1)
|
||||||
+ifeq ($(shell echo $(OS_NAME) | grep -c "OpenBSD"),1)
|
+ifeq ($(OS_NAME),OpenBSD)
|
||||||
CFLAGS += -D_OPENBSD -D HAS_IFHEAD
|
CFLAGS += -D_OPENBSD -D HAS_IFHEAD
|
||||||
# 2.7-2.9
|
# 2.7-2.9
|
||||||
-ifeq ($(shell uname -r | cut -c 1),2)
|
-ifeq ($(shell uname -r | cut -c 1),2)
|
||||||
@ -72,30 +72,30 @@ diff -urN aiccu/unix-console/Makefile aiccu.new/unix-console/Makefile
|
|||||||
CFLAGS += -D AICCU_TYPE="\"openbsd2\""
|
CFLAGS += -D AICCU_TYPE="\"openbsd2\""
|
||||||
SRCS += ../common/aiccu_openbsd2.c
|
SRCS += ../common/aiccu_openbsd2.c
|
||||||
OBJS += ../common/aiccu_openbsd2.o
|
OBJS += ../common/aiccu_openbsd2.o
|
||||||
@@ -114,7 +117,7 @@
|
@@ -114,7 +115,7 @@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Darwin
|
# Darwin
|
||||||
-ifeq ($(shell uname | grep -c "Darwin"),1)
|
-ifeq ($(shell uname | grep -c "Darwin"),1)
|
||||||
+ifeq ($(shell echo $(OS_NAME) | grep -c "Darwin"),1)
|
+ifeq ($(OS_NAME),Darwin)
|
||||||
CFLAGS += -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\""
|
CFLAGS += -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\""
|
||||||
SRCS += ../common/aiccu_darwin.c
|
SRCS += ../common/aiccu_darwin.c
|
||||||
OBJS += ../common/aiccu_darwin.o
|
OBJS += ../common/aiccu_darwin.o
|
||||||
@@ -122,7 +125,7 @@
|
@@ -122,7 +123,7 @@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# SunOS / Solaris
|
# SunOS / Solaris
|
||||||
-ifeq ($(shell uname | grep -c "SunOS"),1)
|
-ifeq ($(shell uname | grep -c "SunOS"),1)
|
||||||
+ifeq ($(shell echo $(OS_NAME) | grep -c "SunOS"),1)
|
+ifeq ($(OS_NAME),SunOS)
|
||||||
CFLAGS += -D_SUNOS -D AICCU_TYPE="\"sunos\""
|
CFLAGS += -D_SUNOS -D AICCU_TYPE="\"sunos\""
|
||||||
SRCS += ../common/aiccu_sunos.c
|
SRCS += ../common/aiccu_sunos.c
|
||||||
OBJS += ../common/aiccu_sunos.o
|
OBJS += ../common/aiccu_sunos.o
|
||||||
@@ -130,7 +133,7 @@
|
@@ -130,7 +131,7 @@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# AIX
|
# AIX
|
||||||
-ifeq ($(shell uname | grep -c "AIX"),1)
|
-ifeq ($(shell uname | grep -c "AIX"),1)
|
||||||
+ifeq ($(shell echo $(OS_NAME) | grep -c "AIX"),1)
|
+ifeq ($(OS_NAME),AIX)
|
||||||
CC = @/usr/vac/bin/xlc_r
|
CC = @/usr/vac/bin/xlc_r
|
||||||
CFLAGS = -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g -qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all
|
CFLAGS = -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g -qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all
|
||||||
CFLAGS += -D AICCU_CONSOLE
|
CFLAGS += -D AICCU_CONSOLE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user