patch-Makefile 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. --- cpufrequtils-007.orig/Makefile 2010-01-16 14:47:44.000000000 +0100
  2. +++ cpufrequtils-007/Makefile 2010-01-23 18:52:15.905985935 +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. @@ -80,7 +82,6 @@ INSTALL = /usr/bin/install -c
  25. INSTALL_PROGRAM = ${INSTALL}
  26. INSTALL_DATA = ${INSTALL} -m 644
  27. INSTALL_SCRIPT = ${INSTALL_PROGRAM}
  28. -LIBTOOL = /usr/bin/libtool
  29. # If you are running a cross compiler, you may want to set this
  30. # to something more interesting, like "arm-linux-". If you want
  31. @@ -116,20 +117,22 @@ WARNINGS += -Wshadow
  32. CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
  33. -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
  34. -UTIL_OBJS = utils/info.c utils/set.c
  35. +UTIL_SRC = utils/info.c utils/set.c
  36. LIB_HEADERS = lib/cpufreq.h lib/interfaces.h
  37. -LIB_OBJS = lib/cpufreq.c lib/proc.c lib/sysfs.c
  38. -LIB_PARTS = lib/cpufreq.lo
  39. +LIB_SRC = lib/cpufreq.c
  40. +LIB_OBJS = lib/cpufreq.o
  41. CFLAGS += -pipe
  42. ifeq ($(strip $(PROC)),true)
  43. - LIB_PARTS += lib/proc.lo
  44. + LIB_OBJS += lib/proc.o
  45. + LIB_SRC += lib/proc.c
  46. CPPFLAGS += -DINTERFACE_PROC
  47. endif
  48. ifeq ($(strip $(SYSFS)),true)
  49. - LIB_PARTS += lib/sysfs.lo
  50. + LIB_OBJS += lib/sysfs.o
  51. + LIB_SRC += lib/sysfs.c
  52. CPPFLAGS += -DINTERFACE_SYSFS
  53. endif
  54. @@ -147,11 +150,9 @@ CFLAGS += $(WARNINGS)
  55. ifeq ($(strip $(V)),false)
  56. QUIET=@$(PWD)/build/ccdv
  57. - LIBTOOL_OPT=--silent
  58. HOST_PROGS=build/ccdv
  59. else
  60. QUIET=
  61. - LIBTOOL_OPT=
  62. HOST_PROGS=
  63. endif
  64. @@ -175,24 +176,26 @@ all: ccdv libcpufreq utils $(COMPILE_NLS
  65. ccdv: build/ccdv
  66. build/ccdv: build/ccdv.c
  67. @echo "Building ccdv"
  68. - @$(HOSTCC) -O1 -O1 $< -o $@
  69. + @$(HOSTCC) -O1 $< -o $@
  70. -%.lo: $(LIB_OBJS) $(LIB_HEADERS) ccdv
  71. - $(QUIET) $(LIBTOOL) $(LIBTOOL_OPT) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $*.c
  72. +lib/%.o: $(LIB_SRC) $(LIB_HEADERS) build/ccdv
  73. + $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
  74. -libcpufreq.la: $(LIB_OBJS) $(LIB_HEADERS) $(LIB_PARTS) Makefile
  75. +libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS)
  76. @if [ $(strip $(SYSFS)) != true -a $(strip $(PROC)) != true ]; then \
  77. echo '*** At least one of /sys support or /proc support MUST be enabled ***'; \
  78. exit -1; \
  79. fi;
  80. - $(QUIET) $(LIBTOOL) $(LIBTOOL_OPT) --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o libcpufreq.la -rpath \
  81. - ${libdir} -version-info $(LIB_VERSION) $(LIB_PARTS)
  82. + $(QUIET) $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
  83. + -Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS)
  84. + @ln -sf $@ libcpufreq.so
  85. + @ln -sf $@ libcpufreq.so.$(LIB_MIN)
  86. -libcpufreq: libcpufreq.la
  87. +libcpufreq: libcpufreq.so.$(LIB_MAJ)
  88. -cpufreq-%: libcpufreq.la $(UTIL_OBJS)
  89. +cpufreq-%: libcpufreq.so.$(LIB_MAJ) $(UTIL_OBJS)
  90. $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I./lib/ -c -o utils/$@.o utils/$*.c
  91. - $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -L./.libs/ -o $@ utils/$@.o -lcpufreq
  92. + $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ utils/$@.o -lcpufreq
  93. $(QUIET) $(STRIPCMD) $@
  94. utils: cpufreq-info cpufreq-set cpufreq-aperf
  95. @@ -217,22 +220,21 @@ update-gmo: po/$(PACKAGE).pot
  96. done;
  97. compile-bench: libcpufreq
  98. - @V=$(V) confdir=$(confdir) make -C bench
  99. + @V=$(V) confdir=$(confdir) $(MAKE) -C bench
  100. clean:
  101. - -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' -o -name '*.l[oas]' \) -type f -print \
  102. + -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
  103. | xargs rm -f
  104. - -rm -rf lib/.libs
  105. - -rm -rf .libs
  106. -rm -f cpufreq-info cpufreq-set cpufreq-aperf
  107. + -rm -f libcpufreq.so*
  108. -rm -f build/ccdv
  109. -rm -rf po/*.gmo po/*.pot
  110. - make -C bench clean
  111. + $(MAKE) -C bench clean
  112. install-lib:
  113. $(INSTALL) -d $(DESTDIR)${libdir}
  114. - $(LIBTOOL) --mode=install $(INSTALL) libcpufreq.la $(DESTDIR)${libdir}/libcpufreq.la
  115. + $(INSTALL) libcpufreq.so* $(DESTDIR)${libdir}/
  116. $(INSTALL) -d $(DESTDIR)${includedir}
  117. $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
  118. @@ -255,7 +257,7 @@ install-gmo:
  119. install-bench:
  120. @#DESTDIR must be set from outside to survive
  121. - @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) make -C bench install
  122. + @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench install
  123. install: install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
  124. @@ -271,5 +273,5 @@ uninstall:
  125. rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpufrequtils.mo; \
  126. done;
  127. -.PHONY: all utils libcpufreq update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \
  128. +.PHONY: all utils libcpufreq ccdv update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \
  129. clean