patch-Makefile 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. --- cpufrequtils-007.orig/Makefile 2010-01-16 14:47:44.000000000 +0100
  2. +++ cpufrequtils-007/Makefile 2010-02-11 20:37:45.000000000 +0100
  3. @@ -27,11 +27,11 @@
  4. DEBUG ?= false
  5. # make the build silent. Set this to something else to make it noisy again.
  6. -V ?= false
  7. +V ?= true
  8. # Internationalization support (output in different languages).
  9. # Requires gettext.
  10. -NLS ?= true
  11. +NLS ?= false
  12. # Set the following to 'true' to build/install the
  13. # cpufreq-bench benchmarking tool
  14. @@ -55,7 +55,9 @@ DESTDIR ?=
  15. # and _should_ modify the PACKAGE_BUGREPORT definition
  16. VERSION = 007
  17. -LIB_VERSION = 0:0:0
  18. +LIB_MAJ= 0.0.0
  19. +LIB_MIN= 0
  20. +
  21. PACKAGE = cpufrequtils
  22. PACKAGE_BUGREPORT = cpufreq@vger.kernel.org
  23. LANGUAGES = de fr it cs pt
  24. @@ -76,16 +78,16 @@ confdir ?= /etc/
  25. # Toolchain: what tools do we use, and what options do they need:
  26. +CP = cp -fpR
  27. INSTALL = /usr/bin/install -c
  28. INSTALL_PROGRAM = ${INSTALL}
  29. INSTALL_DATA = ${INSTALL} -m 644
  30. INSTALL_SCRIPT = ${INSTALL_PROGRAM}
  31. -LIBTOOL = /usr/bin/libtool
  32. # If you are running a cross compiler, you may want to set this
  33. # to something more interesting, like "arm-linux-". If you want
  34. # to compile vs uClibc, that can be done here as well.
  35. -CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
  36. +CROSS ?= #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
  37. CC = $(CROSS)gcc
  38. LD = $(CROSS)gcc
  39. AR = $(CROSS)ar
  40. @@ -116,20 +118,22 @@ WARNINGS += -Wshadow
  41. CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
  42. -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
  43. -UTIL_OBJS = utils/info.c utils/set.c
  44. +UTIL_SRC = utils/info.c utils/set.c
  45. LIB_HEADERS = lib/cpufreq.h lib/interfaces.h
  46. -LIB_OBJS = lib/cpufreq.c lib/proc.c lib/sysfs.c
  47. -LIB_PARTS = lib/cpufreq.lo
  48. +LIB_SRC = lib/cpufreq.c
  49. +LIB_OBJS = lib/cpufreq.o
  50. CFLAGS += -pipe
  51. ifeq ($(strip $(PROC)),true)
  52. - LIB_PARTS += lib/proc.lo
  53. + LIB_OBJS += lib/proc.o
  54. + LIB_SRC += lib/proc.c
  55. CPPFLAGS += -DINTERFACE_PROC
  56. endif
  57. ifeq ($(strip $(SYSFS)),true)
  58. - LIB_PARTS += lib/sysfs.lo
  59. + LIB_OBJS += lib/sysfs.o
  60. + LIB_SRC += lib/sysfs.c
  61. CPPFLAGS += -DINTERFACE_SYSFS
  62. endif
  63. @@ -147,11 +151,9 @@ CFLAGS += $(WARNINGS)
  64. ifeq ($(strip $(V)),false)
  65. QUIET=@$(PWD)/build/ccdv
  66. - LIBTOOL_OPT=--silent
  67. HOST_PROGS=build/ccdv
  68. else
  69. QUIET=
  70. - LIBTOOL_OPT=
  71. HOST_PROGS=
  72. endif
  73. @@ -175,31 +177,32 @@ all: ccdv libcpufreq utils $(COMPILE_NLS
  74. ccdv: build/ccdv
  75. build/ccdv: build/ccdv.c
  76. @echo "Building ccdv"
  77. - @$(HOSTCC) -O1 -O1 $< -o $@
  78. + @$(HOSTCC) -O1 $< -o $@
  79. -%.lo: $(LIB_OBJS) $(LIB_HEADERS) ccdv
  80. - $(QUIET) $(LIBTOOL) $(LIBTOOL_OPT) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $*.c
  81. +lib/%.o: $(LIB_SRC) $(LIB_HEADERS) build/ccdv
  82. + $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
  83. -libcpufreq.la: $(LIB_OBJS) $(LIB_HEADERS) $(LIB_PARTS) Makefile
  84. +libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS)
  85. @if [ $(strip $(SYSFS)) != true -a $(strip $(PROC)) != true ]; then \
  86. echo '*** At least one of /sys support or /proc support MUST be enabled ***'; \
  87. exit -1; \
  88. fi;
  89. - $(QUIET) $(LIBTOOL) $(LIBTOOL_OPT) --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o libcpufreq.la -rpath \
  90. - ${libdir} -version-info $(LIB_VERSION) $(LIB_PARTS)
  91. + $(QUIET) $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
  92. + -Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS)
  93. + @ln -sf $@ libcpufreq.so
  94. + @ln -sf $@ libcpufreq.so.$(LIB_MIN)
  95. -libcpufreq: libcpufreq.la
  96. +libcpufreq: libcpufreq.so.$(LIB_MAJ)
  97. -cpufreq-%: libcpufreq.la $(UTIL_OBJS)
  98. +cpufreq-%: libcpufreq.so.$(LIB_MAJ) $(UTIL_SRC)
  99. $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I./lib/ -c -o utils/$@.o utils/$*.c
  100. - $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -L./.libs/ -o $@ utils/$@.o -lcpufreq
  101. - $(QUIET) $(STRIPCMD) $@
  102. + $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ utils/$@.o -lcpufreq
  103. utils: cpufreq-info cpufreq-set cpufreq-aperf
  104. -po/$(PACKAGE).pot: $(UTIL_OBJS)
  105. +po/$(PACKAGE).pot: $(UTIL_SRC)
  106. @xgettext --default-domain=$(PACKAGE) --add-comments \
  107. - --keyword=_ --keyword=N_ $(UTIL_OBJS) && \
  108. + --keyword=_ --keyword=N_ $(UTIL_SRC) && \
  109. test -f $(PACKAGE).po && \
  110. mv -f $(PACKAGE).po po/$(PACKAGE).pot
  111. @@ -217,22 +220,21 @@ update-gmo: po/$(PACKAGE).pot
  112. done;
  113. compile-bench: libcpufreq
  114. - @V=$(V) confdir=$(confdir) make -C bench
  115. + @V=$(V) confdir=$(confdir) $(MAKE) -C bench
  116. clean:
  117. - -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' -o -name '*.l[oas]' \) -type f -print \
  118. + -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
  119. | xargs rm -f
  120. - -rm -rf lib/.libs
  121. - -rm -rf .libs
  122. -rm -f cpufreq-info cpufreq-set cpufreq-aperf
  123. + -rm -f libcpufreq.so*
  124. -rm -f build/ccdv
  125. -rm -rf po/*.gmo po/*.pot
  126. - make -C bench clean
  127. + $(MAKE) -C bench clean
  128. install-lib:
  129. $(INSTALL) -d $(DESTDIR)${libdir}
  130. - $(LIBTOOL) --mode=install $(INSTALL) libcpufreq.la $(DESTDIR)${libdir}/libcpufreq.la
  131. + $(CP) libcpufreq.so* $(DESTDIR)${libdir}/
  132. $(INSTALL) -d $(DESTDIR)${includedir}
  133. $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
  134. @@ -255,9 +257,9 @@ install-gmo:
  135. install-bench:
  136. @#DESTDIR must be set from outside to survive
  137. - @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) make -C bench install
  138. + @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench install
  139. -install: install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
  140. +install: all install-lib install-tools $(INSTALL_NLS) $(INSTALL_BENCH)
  141. uninstall:
  142. -rm -f $(DESTDIR)${libdir}/libcpufreq.*
  143. @@ -271,5 +273,5 @@ uninstall:
  144. rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpufrequtils.mo; \
  145. done;
  146. -.PHONY: all utils libcpufreq update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \
  147. +.PHONY: all utils libcpufreq ccdv update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \
  148. clean