rename dhcp6 patches and remove intrusive STAGING_DIR references, Makefile cleanup

git-svn-id: svn://svn.openwrt.org/openwrt/packages@5337 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2006-10-30 09:35:06 +00:00
parent d1cac1e535
commit 4ae1153ec8
3 changed files with 76 additions and 80 deletions

View File

@ -11,31 +11,36 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dhcp6
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_MD5SUM:=86193dfa62137db3ea459543db4f1102
PKG_SOURCE_URL:=@SF/dhcpv6-linux
PKG_SOURCE:=dhcpv6-linux-$(PKG_VERSION).zip
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=@SF/dhcpv6-linux
PKG_MD5SUM:=86193dfa62137db3ea459543db4f1102
PKG_CAT:=unzip
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/dhcp6
define Package/dhcp6/Default
SECTION:=ipv6
CATEGORY:=IPv6
DEPENDS:=+libncurses
SUBMENU:=IPv6 DHCP server and client
TITLE:=IPv6 DHCP server and client
DESCRIPTION:=IPv6 DHCP server and client
TITLE:=IPv6 DHCP
URL:=http://sourceforge.net/projects/dhcpv6-linux
endef
define Package/dhcp6-client
$(call Package/dhcp6/Default)
TITLE+= client
endef
define Package/dhcp6-client/conffiles
/etc/dhcp6/solicit.conf
endef
define Package/dhcp6-server
$(call Package/dhcp6)
DEFAULT:=m if ALL
TITLE:=DHCPv6 server
DESCRIPTION:=DHCPv6 server
$(call Package/dhcp6/Default)
TITLE+= server
endef
define Package/dhcp6-server/conffiles
@ -44,28 +49,15 @@ define Package/dhcp6-server/conffiles
/etc/dhcpd6/partial_leases6.conf
endef
define Package/dhcp6-client
$(call Package/dhcp6)
DEFAULT:=m if ALL
TITLE:=DHCPv6 client
DESCRIPTION:=DHCPv6 client
endef
define Package/dhcp6-client/conffiles
/etc/dhcp6/solicit.conf
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/server \
CC="$(TARGET_CC)" STAGING_DIR=$(STAGING_DIR)
$(MAKE) -C $(PKG_BUILD_DIR)/client \
CC="$(TARGET_CC)" STAGING_DIR=$(STAGING_DIR)
endef
define Package/dhcp6-server/install
install -d -m0755 $(1)/usr/sbin $(1)/etc/dhcpd6
install -m0755 $(PKG_BUILD_DIR)/server/serv $(1)/usr/sbin/dhcpd6
install -m0755 $(PKG_BUILD_DIR)/server/*.conf $(1)/etc/dhcpd6/
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib"
$(MAKE) -C $(PKG_BUILD_DIR)/server \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib"
endef
define Package/dhcp6-client/install
@ -74,5 +66,11 @@ define Package/dhcp6-client/install
install -m0755 $(PKG_BUILD_DIR)/client/solicit.conf $(1)/etc/dhcp6/
endef
$(eval $(call BuildPackage,dhcp6-server))
define Package/dhcp6-server/install
install -d -m0755 $(1)/usr/sbin $(1)/etc/dhcpd6
install -m0755 $(PKG_BUILD_DIR)/server/serv $(1)/usr/sbin/dhcpd6
install -m0755 $(PKG_BUILD_DIR)/server/*.conf $(1)/etc/dhcpd6/
endef
$(eval $(call BuildPackage,dhcp6-client))
$(eval $(call BuildPackage,dhcp6-server))

View File

@ -1,118 +1,94 @@
diff -urN orig/dhcp6-1.0/client/Makefile dhcp6-1.0/client/Makefile
--- orig/dhcp6-1.0/client/Makefile 2025-06-28 23:21:40.000000000 +0200
+++ dhcp6-1.0/client/Makefile 2005-12-13 13:43:11.000000000 +0100
@@ -1,42 +1,40 @@
-
-CC = gcc
@@ -3,40 +3,40 @@
STD_HEADERS = stdhead.h head.h struct.h options_type.h message_type.h states.h timer_val.h constants.h macros.h status_codes.h
OBJECT_FILES = client.o solicit.o clilib.o parse.o request.o decline.o renew.o rebind.o release.o
HEADER_FILES = solicit.h clilib.h parse.h request.h decline.h renew.h rebind.h release.h
-
+IFLAGS = -I$(STAGING_DIR)/usr/include
+CFLAGS = -g3
dhcpv6_client : dhcpv6_client.c cli
- $(CC) -g3 dhcpv6_client.c -o dhcpv6_client
+ $(CC) $(IFLAGS) dhcpv6_client.c -o dhcpv6_client
+ $(CC) $(CFLAGS) $(LDFLAGS) dhcpv6_client.c -o dhcpv6_client
cli : $(OBJECT_FILES)
- $(CC) -g3 $(OBJECT_FILES) -o cli -lncurses
+ $(CC) $(IFLAGS) $(OBJECT_FILES) -o cli -L$(STAGING_DIR)/usr/lib -lncurses
+ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECT_FILES) -o cli -lncurses
client.o : client.c $(STD_HEADERS) $(HEADER_FILES)
- $(CC) -g3 -c client.c -o client.o
+ $(CC) $(IFLAGS) -c client.c -o client.o
+ $(CC) $(CFLAGS) -c client.c -o client.o
release.o : release.c release.h clilib.h
- $(CC) -g3 -c release.c -o release.o
+ $(CC) $(IFLAGS) -c release.c -o release.o
+ $(CC) $(CFLAGS) -c release.c -o release.o
rebind.o : rebind.c rebind.h clilib.h
- $(CC) -g3 -c rebind.c -o rebind.o
+ $(CC) $(IFLAGS) -c rebind.c -o rebind.o
+ $(CC) $(CFLAGS) -c rebind.c -o rebind.o
renew.o : renew.c renew.h clilib.h
- $(CC) -g3 -c renew.c -o renew.o
+ $(CC) $(IFLAGS) -c renew.c -o renew.o
+ $(CC) $(CFLAGS) -c renew.c -o renew.o
request.o : request.c request.h clilib.h
- $(CC) -g3 -c request.c -o request.o
+ $(CC) $(IFLAGS) -c request.c -o request.o
+ $(CC) $(CFLAGS) -c request.c -o request.o
decline.o : decline.c decline.h clilib.h parse.h solicit.h
- $(CC) -g3 -c decline.c -o decline.o
+ $(CC) $(IFLAGS) -c decline.c -o decline.o
+ $(CC) $(CFLAGS) -c decline.c -o decline.o
solicit.o : solicit.c solicit.h clilib.h parse.h
- $(CC) -g3 -c solicit.c -o solicit.o
+ $(CC) $(IFLAGS) -c solicit.c -o solicit.o
+ $(CC) $(CFLAGS) -c solicit.c -o solicit.o
clilib.o : clilib.c clilib.h parse.h
- $(CC) -g3 -c clilib.c -o clilib.o
+ $(CC) $(IFLAGS) -c clilib.c -o clilib.o
+ $(CC) $(CFLAGS) -c clilib.c -o clilib.o
parse.o : parse.c parse.h clilib.h
- $(CC) -g3 -c parse.c -o parse.o
+ $(CC) $(IFLAGS) -c parse.c -o parse.o
+ $(CC) $(CFLAGS) -c parse.c -o parse.o
clean :
rm -f *.o cli dhcpv6_client
diff -urN orig/dhcp6-1.0/client/clilib.c dhcp6-1.0/client/clilib.c
--- orig/dhcp6-1.0/client/clilib.c 2025-06-28 23:21:40.000000000 +0200
+++ dhcp6-1.0/client/clilib.c 2005-12-13 13:42:43.000000000 +0100
@@ -554,7 +554,7 @@
void generate_trans_id (u_int32_t *trans_id)
{
- extern u_int32_t g_trans_id;
+ extern int g_trans_id;
time_t t;
srand (time (&t));
*trans_id = 0;
@@ -890,9 +890,7 @@
break;
default :
-#if DEBUG == 3
printf ("Unrecognized DUID type\n");
-#endif
}
next_opt = (struct OPTIONS *) malloc (sizeof (struct OPTIONS));
diff -urN orig/dhcp6-1.0/server/Makefile dhcp6-1.0/server/Makefile
--- orig/dhcp6-1.0/server/Makefile 2002-06-28 14:50:04.000000000 +0200
+++ dhcp6-1.0/server/Makefile 2005-12-13 11:35:53.000000000 +0100
@@ -1,27 +1,26 @@
-CC = gcc
@@ -1,27 +1,28 @@
CC = gcc
STD_HEADERS = stdhead.h head.h struct.h options_type.h message_type.h macros.h status_codes.h constants.h
OBJECT_FILES = server.o lib.o advertise.o parse.o leases.o reply.o
+CFLAGS = -g3
serv: $(OBJECT_FILES)
- $(CC) -g3 $(OBJECT_FILES) -o serv
+ $(CC) $(OBJECT_FILES) -o serv
+ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECT_FILES) -o serv
lib.o: lib.c lib.h $(STD_HEADERS)
- $(CC) -g3 -c lib.c -o lib.o
+ $(CC) -c lib.c -o lib.o
+ $(CC) $(CFLAGS) -c lib.c -o lib.o
parse.o: parse.c parse.h $(STD_HEADERS)
- $(CC) -g3 -c parse.c -o parse.o
+ $(CC) -c parse.c -o parse.o
+ $(CC) $(CFLAGS) -c parse.c -o parse.o
leases.o: leases.c leases.h $(STD_HEADERS)
- $(CC) -g3 -c leases.c -o leases.o
+ $(CC) -c leases.c -o leases.o
+ $(CC) $(CFLAGS) -c leases.c -o leases.o
advertise.o: advertise.c advertise.h $(STD_HEADERS)
- $(CC) -g3 -c advertise.c -o advertise.o
+ $(CC) -c advertise.c -o advertise.o
+ $(CC) $(CFLAGS) -c advertise.c -o advertise.o
reply.o: reply.c reply.h $(STD_HEADERS)
- $(CC) -g3 -c reply.c -o reply.o
+ $(CC) -c reply.c -o reply.o
+ $(CC) $(CFLAGS) -c reply.c -o reply.o
server.o: server.c lib.h advertise.h reply.h leases.h parse.h $(STD_HEADERS)
- $(CC) -g3 -c server.c -o server.o
+ $(CC) -c server.c -o server.o
+ $(CC) $(CFLAGS) -c server.c -o server.o
clean:
rm -f *.o serv

View File

@ -0,0 +1,22 @@
diff -urN orig/dhcp6-1.0/client/clilib.c dhcp6-1.0/client/clilib.c
--- orig/dhcp6-1.0/client/clilib.c 2025-06-28 23:21:40.000000000 +0200
+++ dhcp6-1.0/client/clilib.c 2005-12-13 13:42:43.000000000 +0100
@@ -554,7 +554,7 @@
void generate_trans_id (u_int32_t *trans_id)
{
- extern u_int32_t g_trans_id;
+ extern int g_trans_id;
time_t t;
srand (time (&t));
*trans_id = 0;
@@ -890,9 +890,7 @@
break;
default :
-#if DEBUG == 3
printf ("Unrecognized DUID type\n");
-#endif
}
next_opt = (struct OPTIONS *) malloc (sizeof (struct OPTIONS));