From 31cc68e8f849f2671c8c9974a75ddf37c7c18e0d Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 28 Sep 2009 14:05:20 +0200 Subject: [PATCH] new package: - add test-rpmatch package for debugging --- packages/debug/install | 6 ++++++ packages/debug/test-rpmatch/build | 7 +++++++ packages/debug/test-rpmatch/install | 8 ++++++++ packages/debug/test-rpmatch/sources/Makefile | 14 ++++++++++++++ packages/debug/test-rpmatch/sources/test.c | 19 +++++++++++++++++++ 5 files changed, 54 insertions(+) create mode 100644 packages/debug/install create mode 100644 packages/debug/test-rpmatch/build create mode 100644 packages/debug/test-rpmatch/install create mode 100644 packages/debug/test-rpmatch/sources/Makefile create mode 100644 packages/debug/test-rpmatch/sources/test.c diff --git a/packages/debug/install b/packages/debug/install new file mode 100644 index 0000000000..8f2a590db9 --- /dev/null +++ b/packages/debug/install @@ -0,0 +1,6 @@ +#!/bin/sh + +. config/options + +$SCRIPTS/install test +$SCRIPTS/install test-rpmatch \ No newline at end of file diff --git a/packages/debug/test-rpmatch/build b/packages/debug/test-rpmatch/build new file mode 100644 index 0000000000..a06dddbba7 --- /dev/null +++ b/packages/debug/test-rpmatch/build @@ -0,0 +1,7 @@ +#!/bin/sh + +. config/options + +$SCRIPTS/build toolchain + +make -C $BUILD/$1 diff --git a/packages/debug/test-rpmatch/install b/packages/debug/test-rpmatch/install new file mode 100644 index 0000000000..ec574d26bb --- /dev/null +++ b/packages/debug/test-rpmatch/install @@ -0,0 +1,8 @@ +#!/bin/sh + +. config/options + +PKG_DIR=`find $PACKAGES -type d -name $1` + +mkdir -p $INSTALL/usr/bin +cp -f $BUILD/$1/test $INSTALL/usr/bin/test-rpmatch diff --git a/packages/debug/test-rpmatch/sources/Makefile b/packages/debug/test-rpmatch/sources/Makefile new file mode 100644 index 0000000000..ea4dfb40b3 --- /dev/null +++ b/packages/debug/test-rpmatch/sources/Makefile @@ -0,0 +1,14 @@ +CC ?= gcc +# CFLAGS = -static -Wall -g3 -ggdb3 -Os +LDFLAGS = + +SRCS = test.c +PROG = test + +all: $(PROG) + +$(PROG): $(SRCS) + $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ + +clean: + rm -f $(PROG) diff --git a/packages/debug/test-rpmatch/sources/test.c b/packages/debug/test-rpmatch/sources/test.c new file mode 100644 index 0000000000..70e486e4c9 --- /dev/null +++ b/packages/debug/test-rpmatch/sources/test.c @@ -0,0 +1,19 @@ +#define _SVID_SOURCE +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + if (argc != 2 || strcmp(argv[1], "--help") == 0) { + fprintf(stderr, "%s response", argv[0]); + exit(EXIT_FAILURE); + } + + setlocale(LC_ALL, ""); + printf("rpmatch() returns: %d", rpmatch(argv[1])); + exit(EXIT_SUCCESS); +} +