linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] iw: Android.mk & version.sh: update for Android based compilation
@ 2016-04-28 13:36 Yongqin Liu
  2016-04-28 23:26 ` Julian Calaby
  0 siblings, 1 reply; 3+ messages in thread
From: Yongqin Liu @ 2016-04-28 13:36 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg, Filipe Brandenburger; +Cc: Yongqin Liu

update the Android.mk file and version.sh script for
Android based compilation

Android.mk:  the same file as the one in AOSP master tip
version.sh:  update to get the version information from the
   git repository where this file is located instead of the
   the current directory where it is executed, otherwise if
   there is .git directory in the current directory, it will
   get the wrong version information.
   And improved the version check since the tag information
   may not be mirrored like what AOSP does now.

Change-Id: I8fa59f0e5c7ebd61b364c77fdccf8e74da2e565c
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
---
 Android.mk | 30 ++++++++++++++++++++----------
 version.sh | 39 +++++++++++++++++++++++++++------------
 2 files changed, 47 insertions(+), 22 deletions(-)

diff --git a/Android.mk b/Android.mk
index 4a50f89..20b0432 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,22 +1,32 @@
 LOCAL_PATH := $(call my-dir)
-IW_SOURCE_DIR := $(LOCAL_PATH)
 
 include $(CLEAR_VARS)
 
-IW_ANDROID_BUILD=y
-NO_PKG_CONFIG=y
-include $(LOCAL_PATH)/Makefile
-
-LOCAL_SRC_FILES := $(patsubst %.o,%.c,$(OBJS))
+LOCAL_SRC_FILES := \
+  iw.c genl.c event.c info.c phy.c \
+  interface.c ibss.c station.c survey.c util.c ocb.c \
+  mesh.c mpath.c mpp.c scan.c reg.c \
+  reason.c status.c connect.c link.c offch.c ps.c cqm.c \
+  bitrate.c wowlan.c coalesce.c roc.c p2p.c vendor.c \
+  sections.c
 
 LOCAL_CFLAGS += -DCONFIG_LIBNL20
+
+# Silence some warnings for now. Needs to be fixed upstream. b/26105799
+LOCAL_CFLAGS += -Wno-unused-parameter \
+                -Wno-sign-compare \
+                -Wno-format
+LOCAL_CLANG_CFLAGS += -Wno-enum-conversion
+
 LOCAL_LDFLAGS := -Wl,--no-gc-sections
-#LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE_TAGS := debug
 LOCAL_STATIC_LIBRARIES := libnl
 LOCAL_MODULE := iw
 
-$(IW_SOURCE_DIR)/version.c:
-	$(IW_SOURCE_DIR)/version.sh $(IW_SOURCE_DIR)/version.c
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_GENERATED_SOURCES := $(local-generated-sources-dir)/version.c
+$(LOCAL_GENERATED_SOURCES) : $(LOCAL_PATH)/version.sh
+	@mkdir -p $(dir $@)
+	$(hide) $< $@
 
 include $(BUILD_EXECUTABLE)
diff --git a/version.sh b/version.sh
index 7ccd419..7f292f3 100755
--- a/version.sh
+++ b/version.sh
@@ -3,20 +3,35 @@
 VERSION="4.3"
 OUT="$1"
 
-if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
-	git update-index --refresh --unmerged > /dev/null
-	descr=$(git describe --match=v*)
+# get the absolute path for the OUT file
+OUT_NAME=$(basename ${OUT})
+OUT_DIR=$(cd $(dirname ${OUT}); pwd)
+OUT="${OUT_DIR}/${OUT_NAME}"
 
-	# on git builds check that the version number above
-	# is correct...
-	[ "${descr%%-*}" = "v$VERSION" ] || exit 2
+# the version check should be under the source directory
+# where this script is located, instead of the currect directory
+# where this script is excuted.
+SRC_DIR=$(dirname $0)
+SRC_DIR=$(cd ${SRC_DIR}; pwd)
+cd "${SRC_DIR}"
 
-	v="${descr#v}"
-	if git diff-index --name-only HEAD | read dummy ; then
-		v="$v"-dirty
-	fi
-else
-	v="$VERSION"
+v=""
+if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
+    git update-index --refresh --unmerged > /dev/null
+    descr=$(git describe --match=v* 2>/dev/null)
+    if [ $? -eq 0 ]; then
+        # on git builds check that the version number above
+        # is correct...
+        if [ "${descr%%-*}" = "v$VERSION" ]; then
+            v="${descr#v}"
+            if git diff-index --name-only HEAD | read dummy ; then
+                v="$v"-dirty
+            fi
+        fi
+    fi
+fi
+if [ -z "${v}" ]; then
+    v="$VERSION"
 fi
 
 echo '#include "iw.h"' > "$OUT"
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] iw: Android.mk & version.sh: update for Android based compilation
  2016-04-28 13:36 [PATCH 1/1] iw: Android.mk & version.sh: update for Android based compilation Yongqin Liu
@ 2016-04-28 23:26 ` Julian Calaby
  2016-05-02  6:33   ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Calaby @ 2016-04-28 23:26 UTC (permalink / raw)
  To: Yongqin Liu; +Cc: linux-wireless, Johannes Berg, Filipe Brandenburger

Hi,

On Thu, Apr 28, 2016 at 11:36 PM, Yongqin Liu <yongqin.liu@linaro.org> wrote:
> update the Android.mk file and version.sh script for
> Android based compilation
>
> Android.mk:  the same file as the one in AOSP master tip
> version.sh:  update to get the version information from the
>    git repository where this file is located instead of the
>    the current directory where it is executed, otherwise if
>    there is .git directory in the current directory, it will
>    get the wrong version information.
>    And improved the version check since the tag information
>    may not be mirrored like what AOSP does now.
>
> Change-Id: I8fa59f0e5c7ebd61b364c77fdccf8e74da2e565c
> Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
> ---
>  Android.mk | 30 ++++++++++++++++++++----------
>  version.sh | 39 +++++++++++++++++++++++++++------------
>  2 files changed, 47 insertions(+), 22 deletions(-)
>
> diff --git a/Android.mk b/Android.mk
> index 4a50f89..20b0432 100644
> --- a/Android.mk
> +++ b/Android.mk
> @@ -1,22 +1,32 @@
>  LOCAL_PATH := $(call my-dir)
> -IW_SOURCE_DIR := $(LOCAL_PATH)
>
>  include $(CLEAR_VARS)
>
> -IW_ANDROID_BUILD=y
> -NO_PKG_CONFIG=y
> -include $(LOCAL_PATH)/Makefile
> -
> -LOCAL_SRC_FILES := $(patsubst %.o,%.c,$(OBJS))
> +LOCAL_SRC_FILES := \
> +  iw.c genl.c event.c info.c phy.c \
> +  interface.c ibss.c station.c survey.c util.c ocb.c \
> +  mesh.c mpath.c mpp.c scan.c reg.c \
> +  reason.c status.c connect.c link.c offch.c ps.c cqm.c \
> +  bitrate.c wowlan.c coalesce.c roc.c p2p.c vendor.c \
> +  sections.c
>
>  LOCAL_CFLAGS += -DCONFIG_LIBNL20
> +
> +# Silence some warnings for now. Needs to be fixed upstream. b/26105799

Comments like this worry me: who is being referred to as "upstream",
what are these warnings and why has nobody fixed them?

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] iw: Android.mk & version.sh: update for Android based compilation
  2016-04-28 23:26 ` Julian Calaby
@ 2016-05-02  6:33   ` Johannes Berg
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2016-05-02  6:33 UTC (permalink / raw)
  To: Julian Calaby, Yongqin Liu; +Cc: linux-wireless, Filipe Brandenburger

On Fri, 2016-04-29 at 09:26 +1000, Julian Calaby wrote:

> > +
> > +# Silence some warnings for now. Needs to be fixed upstream.
> > b/26105799
> Comments like this worry me: who is being referred to as "upstream",
> what are these warnings and why has nobody fixed them?
> 

It's funny, because we're upstream (the kernel.org iw repository I
maintain) and they're submitting a Makefile to the same upstream -
saying that "upstream" should fix warnings.

In reality, it's a deluded comment - the warnings from -Wunused-
parameter are entirely useless and cannot be fixed without cluttering
the code with __maybe_unused (or so) since the functions implement
APIs.

This alone is a reason to reject this patch.

If there are legitimate warnings, submit patches first to fix them (and
perhaps add the relevant warning to the real Makefile).

If I then reject those "fixes", don't put such a baselessly accusatory
comment into the Makefile.

johannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-02  6:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-28 13:36 [PATCH 1/1] iw: Android.mk & version.sh: update for Android based compilation Yongqin Liu
2016-04-28 23:26 ` Julian Calaby
2016-05-02  6:33   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).