diff options
-rw-r--r-- | patches/cpufrequtils-002/generic/build-system-fix.diff | 68 | ||||
-rw-r--r-- | patches/cpufrequtils-002/generic/series | 1 | ||||
-rw-r--r-- | rules/cpufrequtils.in | 25 | ||||
-rw-r--r-- | rules/cpufrequtils.make | 132 |
4 files changed, 226 insertions, 0 deletions
diff --git a/patches/cpufrequtils-002/generic/build-system-fix.diff b/patches/cpufrequtils-002/generic/build-system-fix.diff new file mode 100644 index 000000000..5dfbe6d3f --- /dev/null +++ b/patches/cpufrequtils-002/generic/build-system-fix.diff @@ -0,0 +1,68 @@ +Fix various issues while cross compiling + +--- + Makefile | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +Index: Makefile +=================================================================== +--- Makefile.orig ++++ Makefile +@@ -73,17 +73,20 @@ INSTALL = /usr/bin/install -c + INSTALL_PROGRAM = ${INSTALL} + INSTALL_DATA = ${INSTALL} -m 644 + INSTALL_SCRIPT = ${INSTALL_PROGRAM} +-LIBTOOL = /usr/bin/libtool ++# --tag required to make libtool happy about the source type ++LIBTOOL = /usr/bin/libtool --tag CC + + # If you are running a cross compiler, you may want to set this + # to something more interesting, like "arm-linux-". If you want + # to compile vs uClibc, that can be done here as well. +-CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- +-CC = $(CROSS)gcc +-LD = $(CROSS)gcc +-AR = $(CROSS)ar +-STRIP = $(CROSS)strip +-RANLIB = $(CROSS)ranlib ++ ++# ptxdist will overwrite them ++#CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- ++#CC = $(CROSS)gcc ++#LD = $(CROSS)gcc ++#AR = $(CROSS)ar ++#STRIP = $(CROSS)strip ++#RANLIB = $(CROSS)ranlib + HOSTCC = gcc + + +@@ -135,7 +138,7 @@ endif + ifeq ($(strip $(SYSFS)),true) + LIB_PARTS += lib/sysfs.lo + CFLAGDEF += -DINTERFACE_SYSFS +- LDFLAGS = -lsysfs ++ LDFLAGS += -lsysfs + endif + + ifeq ($(strip $(NLS)),true) +@@ -144,7 +147,7 @@ ifeq ($(strip $(NLS)),true) + endif + + +-CFLAGS += $(WARNINGS) -I$(GCCINCDIR) ++CFLAGS += $(WARNINGS) -I$(GCCINCDIR) $(CPPFLAGS) + + ifeq ($(strip $(V)),false) + QUIET=@$(PWD)/build/ccdv +@@ -190,9 +193,8 @@ libcpufreq.la: $(LIB_OBJS) $(LIB_HEADERS + libcpufreq: libcpufreq.la + + cpufreq-%: $(UTIL_OBJS) +- $(QUIET) $(CC) $(CFLAGDEF) $(CFLAGS) -g -I. -I./lib/ -c -o utils/$@.o utils/$*.c +- $(QUIET) $(CC) $(CFLAGDEF) $(CFLAGS) -g -I./lib/ -L. -L./.libs/ -lcpufreq -o $@ utils/$@.o +- $(QUIET) $(STRIPCMD) $@ ++ $(QUIET) $(CC) $(CFLAGDEF) $(CFLAGS) -O2 -g -I. -I./lib/ -c -o utils/$@.o utils/$*.c ++ $(QUIET) $(CC) $(CFLAGDEF) $(CFLAGS) $(LDFLAGS) -g -I./lib/ -L. -L./.libs/ -lcpufreq -o $@ utils/$@.o + + utils: cpufreq-info cpufreq-set + diff --git a/patches/cpufrequtils-002/generic/series b/patches/cpufrequtils-002/generic/series new file mode 100644 index 000000000..b052d17a5 --- /dev/null +++ b/patches/cpufrequtils-002/generic/series @@ -0,0 +1 @@ +build-system-fix.diff -p0 diff --git a/rules/cpufrequtils.in b/rules/cpufrequtils.in new file mode 100644 index 000000000..819afc685 --- /dev/null +++ b/rules/cpufrequtils.in @@ -0,0 +1,25 @@ +menuconfig CPUFREQUTILS + bool + prompt "cpufrequtils " + select SYSFSUTILS + select SYSFSUTILS_LIB + help + To make access to the Linux kernel cpufreq subsystem easier for + users and cpufreq userspace tools, a cpufrequtils package was + created. + Refer http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html + This package requires the sysfsutils. + +config CPUFREQUTILS_FREQ_INFO + depends on CPUFREQUTILS + bool + prompt "install cpufreq-info" + help + Command line tools to determine current CPUfreq setting + +config CPUFREQUTILS_FREQ_SET + depends on CPUFREQUTILS + bool + prompt "install cpufreq-info" + help + Command line tools to set current CPUfreq diff --git a/rules/cpufrequtils.make b/rules/cpufrequtils.make new file mode 100644 index 000000000..ef5b9f085 --- /dev/null +++ b/rules/cpufrequtils.make @@ -0,0 +1,132 @@ +# +# Copyright (C) 2008 by Juergen Beisert +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_CPUFREQUTILS) += cpufrequtils + +# +# Paths and names +# +CPUFREQUTILS_VERSION := 002 +CPUFREQUTILS := cpufrequtils-$(CPUFREQUTILS_VERSION) +CPUFREQUTILS_SUFFIX := tar.bz2 +CPUFREQUTILS_URL := http://www.kernel.org/pub/linux/utils/kernel/cpufreq/$(CPUFREQUTILS).$(CPUFREQUTILS_SUFFIX) +CPUFREQUTILS_SOURCE := $(SRCDIR)/$(CPUFREQUTILS).$(CPUFREQUTILS_SUFFIX) +CPUFREQUTILS_DIR := $(BUILDDIR)/$(CPUFREQUTILS) + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +$(STATEDIR)/cpufrequtils.get: + @$(call targetinfo, $@) + @$(call touch, $@) + +$(CPUFREQUTILS_SOURCE): + @$(call targetinfo, $@) + @$(call get, CPUFREQUTILS) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +$(STATEDIR)/cpufrequtils.extract: + @$(call targetinfo, $@) + @$(call clean, $(CPUFREQUTILS_DIR)) + @$(call extract, CPUFREQUTILS) + @$(call patchin, CPUFREQUTILS) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +CPUFREQUTILS_PATH := PATH=$(CROSS_PATH) +CPUFREQUTILS_ENV := \ + $(CROSS_ENV) \ + NLS=false \ + V=true + +$(STATEDIR)/cpufrequtils.prepare: + @$(call targetinfo, $@) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +# FIXME: Uses /usr/bin/libtool +# FIXME: Uses /usr/bin/install + +$(STATEDIR)/cpufrequtils.compile: + @$(call targetinfo, $@) + cd $(CPUFREQUTILS_DIR) && $(CPUFREQUTILS_PATH) $(CPUFREQUTILS_ENV) \ + $(MAKE) $(PARALLELMFLAGS) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/cpufrequtils.install: + @$(call targetinfo, $@) + @$(call install, CPUFREQUTILS) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/cpufrequtils.targetinstall: + @$(call targetinfo, $@) + + @$(call install_init, cpufrequtils) + @$(call install_fixup, cpufrequtils,PACKAGE,cpufrequtils) + @$(call install_fixup, cpufrequtils,PRIORITY,optional) + @$(call install_fixup, cpufrequtils,VERSION,$(CPUFREQUTILS_VERSION)) + @$(call install_fixup, cpufrequtils,SECTION,base) + @$(call install_fixup, cpufrequtils,AUTHOR,"Juergen Beisert <j.beisert\@pengutronix.de>") + @$(call install_fixup, cpufrequtils,DEPENDS,) + @$(call install_fixup, cpufrequtils,DESCRIPTION,missing) + + @$(call install_copy, cpufrequtils, 0, 0, 0755, \ + $(CPUFREQUTILS_DIR)/.libs/libcpufreq.so.0.0.0, \ + /usr/lib/libcpufreq.so.0.0.0) + @$(call install_link, cpufrequtils, \ + libcpufreq.so.0.0.0, \ + /usr/lib/libcpufreq.so.0) + @$(call install_link, cpufrequtils, \ + libconfuse.so.0, \ + /usr/lib/libconfuse.so) + +ifdef PTXCONF_CPUFREQUTILS_FREQ_INFO + @$(call install_copy, cpufrequtils, 0, 0, 0755, \ + $(CPUFREQUTILS_DIR)/cpufreq-info, /usr/bin/cpufreq-info) +endif +ifdef PTXCONF_CPUFREQUTILS_FREQ_SET + @$(call install_copy, cpufrequtils, 0, 0, 0755, \ + $(CPUFREQUTILS_DIR)/cpufreq-set, /usr/bin/cpufreq-set) +endif + + @$(call install_finish, cpufrequtils) + + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +cpufrequtils_clean: + rm -rf $(STATEDIR)/cpufrequtils.* + rm -rf $(IMAGEDIR)/cpufrequtils_* + rm -rf $(CPUFREQUTILS_DIR) + +# vim: syntax=make |