patch-Makefile 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. - allow passing libtool options via environment variables
  2. - drop hard-coded -rpath flag when linking with libtool (distracts tagged configs)
  3. --- cpufrequtils-007.orig/Makefile Sat Jan 16 14:47:44 2010
  4. +++ cpufrequtils-007/Makefile Thu Jan 21 19:05:16 2010
  5. @@ -27,11 +27,11 @@
  6. DEBUG ?= false
  7. # make the build silent. Set this to something else to make it noisy again.
  8. -V ?= false
  9. +V ?= true
  10. # Internationalization support (output in different languages).
  11. # Requires gettext.
  12. -NLS ?= true
  13. +NLS ?= false
  14. # Set the following to 'true' to build/install the
  15. # cpufreq-bench benchmarking tool
  16. @@ -42,7 +42,7 @@ CPUFRQ_BENCH ?= false
  17. SYSFS ?= true
  18. # Use the proc-based interface which is used in the 2.4 patch for cpufreq
  19. -PROC ?= true
  20. +PROC ?= false
  21. # Prefix to the directories we're installing to
  22. DESTDIR ?=
  23. @@ -55,7 +55,7 @@ DESTDIR ?=
  24. # and _should_ modify the PACKAGE_BUGREPORT definition
  25. VERSION = 007
  26. -LIB_VERSION = 0:0:0
  27. +LIB_VERSION = 0.0.0
  28. PACKAGE = cpufrequtils
  29. PACKAGE_BUGREPORT = cpufreq@vger.kernel.org
  30. LANGUAGES = de fr it cs pt
  31. @@ -80,7 +80,6 @@ INSTALL = /usr/bin/install -c
  32. INSTALL_PROGRAM = ${INSTALL}
  33. INSTALL_DATA = ${INSTALL} -m 644
  34. INSTALL_SCRIPT = ${INSTALL_PROGRAM}
  35. -LIBTOOL = /usr/bin/libtool
  36. # If you are running a cross compiler, you may want to set this
  37. # to something more interesting, like "arm-linux-". If you want
  38. @@ -113,23 +112,18 @@ WARNINGS += $(call cc-supports,-Wno-pointer-sign)
  39. WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
  40. WARNINGS += -Wshadow
  41. -CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
  42. +CPPFLAGS += -I./lib -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
  43. -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
  44. -UTIL_OBJS = utils/info.c utils/set.c
  45. +UTIL_OBJS = utils/info.o utils/set.o
  46. LIB_HEADERS = lib/cpufreq.h lib/interfaces.h
  47. -LIB_OBJS = lib/cpufreq.c lib/proc.c lib/sysfs.c
  48. -LIB_PARTS = lib/cpufreq.lo
  49. +LIB_OBJS = lib/cpufreq.o lib/sysfs.o
  50. -CFLAGS += -pipe
  51. -
  52. ifeq ($(strip $(PROC)),true)
  53. - LIB_PARTS += lib/proc.lo
  54. CPPFLAGS += -DINTERFACE_PROC
  55. endif
  56. ifeq ($(strip $(SYSFS)),true)
  57. - LIB_PARTS += lib/sysfs.lo
  58. CPPFLAGS += -DINTERFACE_SYSFS
  59. endif
  60. @@ -147,11 +141,11 @@ CFLAGS += $(WARNINGS)
  61. ifeq ($(strip $(V)),false)
  62. QUIET=@$(PWD)/build/ccdv
  63. - LIBTOOL_OPT=--silent
  64. + LIBTOOL_OPT+=--silent
  65. HOST_PROGS=build/ccdv
  66. else
  67. QUIET=
  68. - LIBTOOL_OPT=
  69. + LIBTOOL_OPT+=
  70. HOST_PROGS=
  71. endif
  72. @@ -175,27 +169,36 @@ all: ccdv libcpufreq utils $(COMPILE_NLS) $(COMPILE_BE
  73. ccdv: build/ccdv
  74. build/ccdv: build/ccdv.c
  75. @echo "Building ccdv"
  76. - @$(HOSTCC) -O1 -O1 $< -o $@
  77. + $(HOSTCC) -O1 $< -o $@
  78. -%.lo: $(LIB_OBJS) $(LIB_HEADERS) ccdv
  79. - $(QUIET) $(LIBTOOL) $(LIBTOOL_OPT) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $*.c
  80. +lib/cpufreq.o: $(LIB_HEADERS)
  81. + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c lib/cpufreq.c
  82. -libcpufreq.la: $(LIB_OBJS) $(LIB_HEADERS) $(LIB_PARTS) Makefile
  83. +lib/sysfs.o: $(LIB_HEADERS)
  84. + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c lib/sysfs.c
  85. +
  86. +utils/info.o:
  87. + $(CC) $(CPPFLAGS) $(CFLAGS) -o utils/cpufreq-info.o -c utils/info.c
  88. +
  89. +utils/set.o:
  90. + $(CC) $(CPPFLAGS) $(CFLAGS) -o utils/cpufreq-set.o -c utils/set.c
  91. +
  92. +libcpufreq.so: $(LIB_OBJS)
  93. @if [ $(strip $(SYSFS)) != true -a $(strip $(PROC)) != true ]; then \
  94. echo '*** At least one of /sys support or /proc support MUST be enabled ***'; \
  95. exit -1; \
  96. fi;
  97. - $(QUIET) $(LIBTOOL) $(LIBTOOL_OPT) --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o libcpufreq.la -rpath \
  98. - ${libdir} -version-info $(LIB_VERSION) $(LIB_PARTS)
  99. + $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o libcpufreq.so.${LIB_VERSION} \
  100. + -Wl,-soname,libcpufreq.so $(LIB_OBJS)
  101. + ln -s libcpufreq.so.${LIB_VERSION} $@
  102. + ln -s libcpufreq.so.${LIB_VERSION} $@.0
  103. -libcpufreq: libcpufreq.la
  104. +libcpufreq: libcpufreq.so
  105. -cpufreq-%: libcpufreq.la $(UTIL_OBJS)
  106. - $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I./lib/ -c -o utils/$@.o utils/$*.c
  107. - $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -L./.libs/ -o $@ utils/$@.o -lcpufreq
  108. - $(QUIET) $(STRIPCMD) $@
  109. +cpufreq-%: libcpufreq.so $(UTIL_OBJS)
  110. + $(CC) $(CFLAGS) $(LDFLAGS) -L. -L./ -o $@ utils/$@.o -lcpufreq
  111. -utils: cpufreq-info cpufreq-set cpufreq-aperf
  112. +utils: cpufreq-info cpufreq-set
  113. po/$(PACKAGE).pot: $(UTIL_OBJS)
  114. @xgettext --default-domain=$(PACKAGE) --add-comments \
  115. @@ -232,7 +235,7 @@ clean:
  116. install-lib:
  117. $(INSTALL) -d $(DESTDIR)${libdir}
  118. - $(LIBTOOL) --mode=install $(INSTALL) libcpufreq.la $(DESTDIR)${libdir}/libcpufreq.la
  119. + $(INSTALL) libcpufreq.so $(DESTDIR)${libdir}/libcpufreq.so
  120. $(INSTALL) -d $(DESTDIR)${includedir}
  121. $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
  122. @@ -240,7 +243,6 @@ install-tools:
  123. $(INSTALL) -d $(DESTDIR)${bindir}
  124. $(INSTALL_PROGRAM) cpufreq-set $(DESTDIR)${bindir}/cpufreq-set
  125. $(INSTALL_PROGRAM) cpufreq-info $(DESTDIR)${bindir}/cpufreq-info
  126. - $(INSTALL_PROGRAM) cpufreq-aperf $(DESTDIR)${bindir}/cpufreq-aperf
  127. install-man:
  128. $(INSTALL_DATA) -D man/cpufreq-set.1 $(DESTDIR)${mandir}/man1/cpufreq-set.1
  129. @@ -257,7 +259,7 @@ install-bench:
  130. @#DESTDIR must be set from outside to survive
  131. @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) make -C bench install
  132. -install: install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
  133. +install: install-lib install-tools $(INSTALL_NLS) $(INSTALL_BENCH)
  134. uninstall:
  135. - rm -f $(DESTDIR)${libdir}/libcpufreq.*