From b251a6c0e72f9b77dd4539c6f62b2c065084a5f4 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Thu, 20 May 2010 20:35:11 -0600 Subject: [PATCH] Update debian files for new libc --- debian/changelog | 6 ++ debian/control | 4 +- debian/patches/001-builddir.dpatch | 76 ------------------------- debian/patches/002-adc12.dpatch | 37 ------------ debian/patches/00list | 4 +- debian/patches/adc12-safe-tinyos.dpatch | 65 +++++++++++++++++++++ debian/patches/makefile.dpatch | 30 ++++++++++ debian/rules | 12 ++-- 8 files changed, 111 insertions(+), 123 deletions(-) delete mode 100755 debian/patches/001-builddir.dpatch delete mode 100755 debian/patches/002-adc12.dpatch create mode 100755 debian/patches/adc12-safe-tinyos.dpatch create mode 100755 debian/patches/makefile.dpatch diff --git a/debian/changelog b/debian/changelog index 0620e1f..c76b813 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +msp430-libc (0.1~20100207-1tmi) hardy; urgency=low + + * Update to oshan version 20100207. + + -- TMI Packages Thu, 20 May 2010 20:12:06 -0600 + msp430-libc (0.0~cvs20080819-1tmi) hardy; urgency=low * Initial release, combining knowledge from mspgcc and tinyos build scripts. diff --git a/debian/control b/debian/control index ba530f7..7e1bf1f 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,11 @@ Section: devel Priority: optional Maintainer: TMI Packages Standards-Version: 3.7.2.0 -Build-Depends: dpkg-dev (>= 1.13.9), autoconf (>= 2.13), bison, flex, gettext, texinfo, binutils (>= 2.9.5.0.12), gcc (>= 4:4.2.2), dejagnu (>= 1.4.2-1.1), dpatch, file, bzip2, lsb-release, msp430-binutils (>= 2.18), msp430-gcc (>= 3.2.3) +Build-Depends: dpkg-dev (>= 1.13.9), autoconf (>= 2.13), bison, flex, gettext, texinfo, binutils (>= 2.9.5.0.12), gcc (>= 4:4.2.2), dejagnu (>= 1.4.2-1.1), dpatch, file, bzip2, lsb-release, msp430-binutils (>= 2.20), msp430-gcc (>= 4.4.3) Package: msp430-libc Architecture: any -Depends: msp430-binutils (>= 2.18), msp430-gcc (>= 3.2.3), ${shlibs:Depends} +Depends: msp430-binutils (>= 2.20), msp430-gcc (>= 4.4.3), ${shlibs:Depends} Suggests: Priority: extra Description: libc for msp430 diff --git a/debian/patches/001-builddir.dpatch b/debian/patches/001-builddir.dpatch deleted file mode 100755 index 6330253..0000000 --- a/debian/patches/001-builddir.dpatch +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 001-builddir.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Allow building outside of source tree - -@DPATCH@ - -diff -urN -x CVS msp430-libc-0.0~cvs20080819.orig/src/Makefile msp430-libc-0.0~cvs20080819/src/Makefile ---- msp430-libc-0.0~cvs20080819.orig/src/Makefile 2008-05-16 20:44:59.000000000 -0600 -+++ msp430-libc-0.0~cvs20080819/src/Makefile 2008-08-22 12:58:47.000000000 -0600 -@@ -93,7 +93,7 @@ - - # match by name - --${crt_all_objs}: crt%.o: gcrt0.S -+${crt_all_objs}: crt%.o: $(srcdir)/gcrt0.S - ${AS} ${CPPFLAGS} -mmcu=msp$* ${ALL_ASFLAGS} -c $(ABSPATH)$< -o $@ - - clean-crt: -@@ -152,16 +152,16 @@ - mspdirs: - mkdir -p msp1 msp2 - --${libc_msp430_objs_1}: msp1/%.o: stdlib/%.c -+${libc_msp430_objs_1}: msp1/%.o: $(srcdir)/stdlib/%.c - ${CC} -c ${CPPFLAGS} ${ALL_CFLAGS} -mmcu=msp1 -c $(ABSPATH)$< -o $@ - --${libc_msp430_objs_2}: msp2/%.o: stdlib/%.c -+${libc_msp430_objs_2}: msp2/%.o: $(srcdir)/stdlib/%.c - ${CC} -c ${CPPFLAGS} ${ALL_CFLAGS} -mmcu=msp2 -c $(ABSPATH)$< -o $@ - --${libc_msp430_S_objs_1}: msp1/%.o: stdlib/%.S -+${libc_msp430_S_objs_1}: msp1/%.o: $(srcdir)/stdlib/%.S - ${AS} -D_GNU_ASSEMBLER_ -mmcu=msp1 -c $(ABSPATH)$< -o $@ - --${libc_msp430_S_objs_2}: msp2/%.o: stdlib/%.S -+${libc_msp430_S_objs_2}: msp2/%.o: $(srcdir)/stdlib/%.S - ${AS} -D_GNU_ASSEMBLER_ -mmcu=msp2 -c $(ABSPATH)$< -o $@ - - libc_msp430_cstr_objs_1 = ${libc_str_sources:%.c=%.o} -@@ -171,10 +171,10 @@ - libc_msp430_str_objs_2 = $(addprefix msp2/, $(libc_msp430_cstr_objs_2)) - - --${libc_msp430_str_objs_1}: msp1/%.o: string/%.c -+${libc_msp430_str_objs_1}: msp1/%.o: $(srcdir)/string/%.c - ${CC} -c ${CPPFLAGS} ${ALL_CFLAGS} -mmcu=msp1 -c $(ABSPATH)$< -o $@ - --${libc_msp430_str_objs_2}: msp2/%.o: string/%.c -+${libc_msp430_str_objs_2}: msp2/%.o: $(srcdir)/string/%.c - ${CC} -c ${CPPFLAGS} ${ALL_CFLAGS} -mmcu=msp2 -c $(ABSPATH)$< -o $@ - - -@@ -267,17 +267,17 @@ - - build-libm: ${libm_libs} - --${libm_msp430_c_objs_1}: msp1/%.o: libm/%.c -+${libm_msp430_c_objs_1}: msp1/%.o: $(srcdir)/libm/%.c - ${CC} -c ${CPPFLAGS} ${ALL_CFLAGS} -mmcu=msp1 -c $(ABSPATH)$< -o $@ - --${libm_msp430_c_objs_2}: msp2/%.o: libm/%.c -+${libm_msp430_c_objs_2}: msp2/%.o: $(srcdir)/libm/%.c - ${CC} -c ${CPPFLAGS} ${ALL_CFLAGS} -mmcu=msp2 -c $(ABSPATH)$< -o $@ - - --${libm_msp430_cf_objs_1}: msp1/%.o: libm/%.c -+${libm_msp430_cf_objs_1}: msp1/%.o: $(srcdir)/libm/%.c - ${CC} ${CPPFLAGS} -mmcu=msp1 ${ALL_CFLAGS} -c $(ABSPATH)$< -o $@ - --${libm_msp430_cf_objs_2}: msp2/%.o: libm/%.c -+${libm_msp430_cf_objs_2}: msp2/%.o: $(srcdir)/libm/%.c - ${CC} ${CPPFLAGS} -mmcu=msp2 ${ALL_CFLAGS} -c $(ABSPATH)$< -o $@ - - diff --git a/debian/patches/002-adc12.dpatch b/debian/patches/002-adc12.dpatch deleted file mode 100755 index e9fe62e..0000000 --- a/debian/patches/002-adc12.dpatch +++ /dev/null @@ -1,37 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 001-adc12.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Patch for proper operation of adc12 peripheral - -@DPATCH@ - -diff -urN -x CVS msp430-libc-0.0~cvs20080819.orig/include/msp430/adc12.h msp430-libc-0.0~cvs20080819/include/msp430/adc12.h ---- msp430-libc-0.0~cvs20080819.orig/include/msp430/adc12.h 2006-01-11 17:47:21.000000000 -0700 -+++ msp430-libc-0.0~cvs20080819/include/msp430/adc12.h 2008-08-22 12:00:32.000000000 -0600 -@@ -94,8 +94,12 @@ - #ifdef _GNU_ASSEMBLER_ - #define ADC12MEM ADC12MEM_ /* ADC12 Conversion Memory (for assembler) */ - #else -+#ifdef SAFE_TINYOS -+#define ADC12MEM TCAST(int* ONE, ADC12MEM_) /* ADC12 Conversion Memory (for C) */ -+#else - #define ADC12MEM ((int*) ADC12MEM_) /* ADC12 Conversion Memory (for C) */ - #endif -+#endif - #define ADC12MEM0_ ADC12MEM_ /* ADC12 Conversion Memory 0 */ - sfrw(ADC12MEM0,ADC12MEM0_); - #define ADC12MEM1_ 0x0142 /* ADC12 Conversion Memory 1 */ -@@ -133,8 +137,12 @@ - #ifdef _GNU_ASSEMBLER_ - #define ADC12MCTL ADC12MCTL_ /* ADC12 Memory Control (for assembler) */ - #else -+#ifdef SAFE_TINYOS -+#define ADC12MCTL TCAST(char * ONE, ADC12MCTL_) -+#else - #define ADC12MCTL ((char*) ADC12MCTL_) /* ADC12 Memory Control (for C) */ - #endif -+#endif - #define ADC12MCTL0_ ADC12MCTL_ /* ADC12 Memory Control 0 */ - sfrb(ADC12MCTL0,ADC12MCTL0_); - #define ADC12MCTL1_ 0x0081 /* ADC12 Memory Control 1 */ diff --git a/debian/patches/00list b/debian/patches/00list index cedb79c..07872bb 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -1,2 +1,2 @@ -001-builddir.dpatch -002-adc12.dpatch +adc12-safe-tinyos +makefile diff --git a/debian/patches/adc12-safe-tinyos.dpatch b/debian/patches/adc12-safe-tinyos.dpatch new file mode 100755 index 0000000..c6125f2 --- /dev/null +++ b/debian/patches/adc12-safe-tinyos.dpatch @@ -0,0 +1,65 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## adc12-safe-tinyos.dpatch by R. Steve McKown +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add support for deputy-tinyos (safe tinyos), if present at compile. + +@DPATCH@ +diff -urNad msp430-libc~/include/msp430/adc12.h msp430-libc/include/msp430/adc12.h +--- msp430-libc~/include/msp430/adc12.h 2010-05-20 20:37:57.000000000 -0600 ++++ msp430-libc/include/msp430/adc12.h 2010-05-20 20:38:46.000000000 -0600 +@@ -94,8 +94,12 @@ + #ifdef __ASSEMBLER__ + #define ADC12MEM ADC12MEM_ /* ADC12 Conversion Memory (for assembler) */ + #else ++#ifdef SAFE_TINYOS ++#define ADC12MEM TCAST(int* ONE, ADC12MEM_) /* ADC12 Conversion Memory (for C) */ ++#else + #define ADC12MEM ((int*) ADC12MEM_) /* ADC12 Conversion Memory (for C) */ + #endif ++#endif + #define ADC12MEM0_ ADC12MEM_ /* ADC12 Conversion Memory 0 */ + sfrw(ADC12MEM0,ADC12MEM0_); + #define ADC12MEM1_ 0x0142 /* ADC12 Conversion Memory 1 */ +@@ -133,8 +137,12 @@ + #ifdef __ASSEMBLER__ + #define ADC12MCTL ADC12MCTL_ /* ADC12 Memory Control (for assembler) */ + #else ++#ifdef SAFE_TINYOS ++#define ADC12MCTL TCAST(char* ONE, ADC12MCTL_) /* ADC12 Memory Control (for C) */ ++#else + #define ADC12MCTL ((char*) ADC12MCTL_) /* ADC12 Memory Control (for C) */ + #endif ++#endif + #define ADC12MCTL0_ ADC12MCTL_ /* ADC12 Memory Control 0 */ + sfrb(ADC12MCTL0,ADC12MCTL0_); + #define ADC12MCTL1_ 0x0081 /* ADC12 Memory Control 1 */ +diff -urNad msp430-libc~/include/msp430/adc12_plus.h msp430-libc/include/msp430/adc12_plus.h +--- msp430-libc~/include/msp430/adc12_plus.h 2010-05-20 20:37:57.000000000 -0600 ++++ msp430-libc/include/msp430/adc12_plus.h 2010-05-20 20:38:58.000000000 -0600 +@@ -161,8 +161,12 @@ + #ifdef __ASM_HEADER__ + #define ADC12MEM ADC12MEM0 /* ADC12 Conversion Memory (for assembler) */ + #else ++#ifdef SAFE_TINYOS ++#define ADC12MEM TCAST(int* ONE, &ADC12MEM0) /* ADC12 Conversion Memory (for C) */ ++#else + #define ADC12MEM ((int*) &ADC12MEM0) /* ADC12 Conversion Memory (for C) */ + #endif ++#endif + + #define ADC12MCTL0_ __MSP430_ADC12_PLUS_BASE__ + 0x10 /* ADC12 Memory Control 0 */ + sfrb(ADC12MCTL0, ADC12MCTL0_); +@@ -200,8 +204,12 @@ + #ifdef __ASM_HEADER__ + #define ADC12MCTL ADC12MCTL0 /* ADC12 Memory Control (for assembler) */ + #else ++#ifdef SAFE_TINYOS ++#define ADC12MCTL TCAST(char* ONE, ADC12MCTL0) /* ADC12 Conversion Memory (for C) */ ++#else + #define ADC12MCTL ((char*) ADC12MCTL0) /* ADC12 Memory Control (for C) */ + #endif ++#endif + + /* ADC12CTL0 Control Bits */ + #define ADC12SC (0x001) /* ADC12 Start Conversion */ diff --git a/debian/patches/makefile.dpatch b/debian/patches/makefile.dpatch new file mode 100755 index 0000000..bce6b88 --- /dev/null +++ b/debian/patches/makefile.dpatch @@ -0,0 +1,30 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## makefile.dpatch by R. Steve McKown +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Don't expect toolchain to be in install prefix. +## DP: Ensure libdir is created. + +@DPATCH@ +diff -urNad msp430-libc~/src/Makefile msp430-libc/src/Makefile +--- msp430-libc~/src/Makefile 2010-05-20 21:07:12.000000000 -0600 ++++ msp430-libc/src/Makefile 2010-05-20 21:07:59.000000000 -0600 +@@ -13,7 +13,9 @@ + target = msp430 + + prefix_target = $(PREFIX)/${target} ++ifndef bindir + bindir = $(PREFIX)/bin ++endif + includedir = ${prefix_target}/include + libdir = ${prefix_target}/lib + +@@ -133,7 +135,7 @@ + ${INSTALL} + + #--------------- directories --------------- +-$(includedir) $(includedir)/sys $(includedir)/msp430: ++$(includedir) $(includedir)/sys $(includedir)/msp430 $(libdir): + $(MD) + #------------------------------------------------------------------------ + #------------------------------------------------------------------------ diff --git a/debian/rules b/debian/rules index 796d55c..4d5cc51 100755 --- a/debian/rules +++ b/debian/rules @@ -26,15 +26,15 @@ DISTRIBUTION := $(shell lsb_release -is) configure-stamp: patch-stamp $(checkdir) - rm -rf configure-stamp builddir - $(install_dir) builddir + rm -rf configure-stamp touch $@ build: build-stamp build-stamp: configure-stamp $(checkdir) - $(MAKE) -C builddir -f $$(pwd)/src/Makefile srcdir=$$(pwd)/src + : # Makefile creates ./Build directory + $(MAKE) -C src PREFIX=$$(pwd)/debian/tmp/usr bindir=/usr/bin touch $@ @@ -43,8 +43,7 @@ install-stamp: checkroot build-stamp $(checkdir) rm -rf debian/tmp $(install_dir) debian/tmp - $(MAKE) -C builddir -f $$(pwd)/src/Makefile srcdir=$$(pwd)/src \ - prefix=$$(pwd)/debian/tmp/usr install + $(MAKE) -C src install PREFIX=$$(pwd)/debian/tmp/usr bindir=/usr/bin ifeq ($(with_strip),yes) find debian/tmp -type f | xargs file | grep "ELF.*executable" | \ cut -f 1 -d : | xargs $(STRIP) @@ -86,7 +85,8 @@ binary: binary-indep binary-arch clean: unpatch $(checkdir) - -rm -rf debian/tmp builddir + $(MAKE) -C src clean + -rm -rf debian/tmp -rm -fr debian/patched debian/files* debian/substvars -rm -f *-stamp -- 2.39.2