Skip to contentSkip to conversation

Yet another round of Android build cleanups

PATCH In review Emil Velikov 2 participants 15 messages Mar 17, 2015 – Mar 20, 2015

lore
Share & tools
lore
#0 lore raw

cover Yet another round of Android build cleanups

Hi all,

As pointed out by Chih-Wei, Android's LOCAL_COPY_HEADERS{,_TO} has been depreciated for quite some time.

Although it was a convenient way of getting things done (no more hard-coding the location of drm) it seems that there is another more appropriate (and cleaner) solution. Namely:
Annotate the includes as "exported" and as the user selects the library for linking, the build will automatically add the includes.

Big thanks to Chih-Wei for the patience and persistence explaining the whole shebang. This series is mostly based on his patch in the Android-x86 tree, with some extra bits from your truly :-)

Chih-Wei,

I've tested this a few times already, although having someone with experience in the whole thing will be appreciated.

Cheers,
Emil

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

PATCH 1/5 android: correcly set LOCAL_EXPORT_C_INCLUDE_DIRS

- Don't add ${hw}/${hw}, but ${hw} to the includes path. The former
does not exist.
- Set the variable for libkms.

Inspired by the work of from Chih-Wei from the Android-x86 project.

---
 Android.mk           | 2 +-
 freedreno/Android.mk | 3 +--
 intel/Android.mk     | 3 +--
 libkms/Android.mk    | 2 ++
 nouveau/Android.mk   | 3 +--
 radeon/Android.mk    | 3 +--
 6 files changed, 7 insertions(+), 9 deletions(-)
Android.mk +1 -1
index 6f76113..e6d85d4 100644
@@ -33,7 +33,7 @@ LOCAL_MODULE := libdrm
 LOCAL_MODULE_TAGS := optional
 
 LOCAL_SRC_FILES := $(LIBDRM_FILES)
-LOCAL_EXPORT_C_INCLUDE_DIRS += \
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/include/drm
 
freedreno/Android.mk +1 -2
index 22520fb..31b90ef 100644
@@ -10,8 +10,7 @@ LOCAL_MODULE_TAGS := optional
 LOCAL_SHARED_LIBRARIES := libdrm
 
 LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
-LOCAL_EXPORT_C_INCLUDE_DIRS += \
-	$(LOCAL_PATH)/freedreno
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
 	$(LIBDRM_TOP) \
intel/Android.mk +1 -2
index 202c0d5..2a6bf60 100644
@@ -31,8 +31,7 @@ LOCAL_MODULE := libdrm_intel
 LOCAL_MODULE_TAGS := optional
 
 LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
-LOCAL_EXPORT_C_INCLUDE_DIRS += \
-	$(LOCAL_PATH)/intel
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
 	$(LIBDRM_TOP) \
libkms/Android.mk +2 -0
index d2df32a..4d41fbc 100644
@@ -45,6 +45,8 @@ endif
 LOCAL_MODULE := libkms
 LOCAL_SHARED_LIBRARIES := libdrm
 
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libdrm
 
 LOCAL_COPY_HEADERS_TO := libdrm
nouveau/Android.mk +1 -2
index 93c9ec2..8e42c40 100644
@@ -10,8 +10,7 @@ LOCAL_MODULE_TAGS := optional
 LOCAL_SHARED_LIBRARIES := libdrm
 
 LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES)
-LOCAL_EXPORT_C_INCLUDE_DIRS += \
-	$(LOCAL_PATH)/nouveau
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
 	$(LIBDRM_TOP) \
radeon/Android.mk +1 -2
index 71c58bd..b4065aa 100644
@@ -10,8 +10,7 @@ LOCAL_MODULE_TAGS := optional
 LOCAL_SHARED_LIBRARIES := libdrm
 
 LOCAL_SRC_FILES := $(LIBDRM_RADEON_FILES)
-LOCAL_EXPORT_C_INCLUDE_DIRS += \
-	$(LOCAL_PATH)/radeon
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
 	$(LIBDRM_TOP) \
Signature · 6 lines
2.1.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 2/5 android: simplify LOCAL_C_INCLUDES

In reply to Emil Velikov

Each of the libdrm_${hw} modules pull libdrm for linking as such:

libdrm's LOCAL_EXPORT_C_INCLUDE_DIRS are added to the includes list. The former of which is already set to ${top} and ${top}/include/drm.

---
 freedreno/Android.mk | 4 +---
 intel/Android.mk     | 2 --
 libkms/Android.mk    | 2 --
 nouveau/Android.mk   | 4 +---
 radeon/Android.mk    | 4 +---
 5 files changed, 3 insertions(+), 13 deletions(-)
freedreno/Android.mk +1 -3
index 31b90ef..d6c19fe 100644
@@ -13,9 +13,7 @@ LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP) \
-	$(LIBDRM_TOP)/freedreno \
-	$(LIBDRM_TOP)/include/drm
+	$(LIBDRM_TOP)/freedreno
 
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
intel/Android.mk +0 -2
index 2a6bf60..8a30fb5 100644
@@ -34,9 +34,7 @@ LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP) \
 	$(LIBDRM_TOP)/intel \
-	$(LIBDRM_TOP)/include/drm \
 	external/libpciaccess/include
 
 LOCAL_CFLAGS := \
libkms/Android.mk +0 -2
index 4d41fbc..3c400de 100644
@@ -47,8 +47,6 @@ LOCAL_SHARED_LIBRARIES := libdrm
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
-LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libdrm
-
 LOCAL_COPY_HEADERS_TO := libdrm
 LOCAL_COPY_HEADERS := $(LIBKMS_H_FILES)
 
nouveau/Android.mk +1 -3
index 8e42c40..6c46f6c 100644
@@ -13,9 +13,7 @@ LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP) \
-	$(LIBDRM_TOP)/nouveau \
-	$(LIBDRM_TOP)/include/drm
+	$(LIBDRM_TOP)/nouveau
 
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
radeon/Android.mk +1 -3
index b4065aa..d9192b6 100644
@@ -13,9 +13,7 @@ LOCAL_SRC_FILES := $(LIBDRM_RADEON_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP) \
-	$(LIBDRM_TOP)/radeon \
-	$(LIBDRM_TOP)/include/drm
+	$(LIBDRM_TOP)/radeon
 
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
Signature · 6 lines
2.1.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 3/5 android: remove ${srcdir} from the includes

In reply to Emil Velikov

Already implicitly handled by the compiler.

---
 freedreno/Android.mk | 3 ---
 intel/Android.mk     | 1 -
 nouveau/Android.mk   | 3 ---
 radeon/Android.mk    | 3 ---
 4 files changed, 10 deletions(-)
freedreno/Android.mk +0 -3
index d6c19fe..9031d61 100644
@@ -12,9 +12,6 @@ LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
-LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP)/freedreno
-
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
intel/Android.mk +0 -1
index 8a30fb5..7397110 100644
@@ -34,7 +34,6 @@ LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP)/intel \
 	external/libpciaccess/include
 
 LOCAL_CFLAGS := \
nouveau/Android.mk +0 -3
index 6c46f6c..5bc325c 100644
@@ -12,9 +12,6 @@ LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
-LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP)/nouveau
-
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
radeon/Android.mk +0 -3
index d9192b6..f12e631 100644
@@ -12,9 +12,6 @@ LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_SRC_FILES := $(LIBDRM_RADEON_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
-LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP)/radeon
-
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
Signature · 6 lines
2.1.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: [PATCH libdrm 3/5] android: remove ${srcdir} from the includes

2015年3月18日 上午7:30 於 "Emil Velikov" <[email protected]> 寫道:

Quoted 2 lines

Already implicitly handled by the compiler.

Actually it's not handled by the compiler, but by the Android build system. It automatically adds $(LOCAL_PATH), $(intermediate), ... to the include paths.

Quoted 65 lines
---
 freedreno/Android.mk | 3 ---
 intel/Android.mk     | 1 -
 nouveau/Android.mk   | 3 ---
 radeon/Android.mk    | 3 ---
 4 files changed, 10 deletions(-)
freedreno/Android.mk +0 -3
index d6c19fe..9031d61 100644
@@ -12,9 +12,6 @@ LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
-LOCAL_C_INCLUDES := \
-       $(LIBDRM_TOP)/freedreno
-
 LOCAL_CFLAGS := \
        -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
intel/Android.mk +0 -1
index 8a30fb5..7397110 100644
@@ -34,7 +34,6 @@ LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
 LOCAL_C_INCLUDES := \
-       $(LIBDRM_TOP)/intel \
        external/libpciaccess/include
 
 LOCAL_CFLAGS := \
nouveau/Android.mk +0 -3
index 6c46f6c..5bc325c 100644
@@ -12,9 +12,6 @@ LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
-LOCAL_C_INCLUDES := \
-       $(LIBDRM_TOP)/nouveau
-
 LOCAL_CFLAGS := \
        -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
radeon/Android.mk +0 -4
index d9192b6..f12e631 100644
@@ -12,9 +12,6 @@ LOCAL_SHARED_LIBRARIES := libdrm
 LOCAL_SRC_FILES := $(LIBDRM_RADEON_FILES)
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
-LOCAL_C_INCLUDES := \
-       $(LIBDRM_TOP)/radeon
-
 LOCAL_CFLAGS := \
        -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
--

2.1.3

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Re: [PATCH libdrm 3/5] android: remove ${srcdir} from the includes

Quoted 9 lines · Chih-Wei Huang

2015年3月18日 上午7:30 於 "Emil Velikov" <[email protected] <mailto:[email protected]>> 寫道:

Quoted 2 lines

Already implicitly handled by the compiler.

Actually it's not handled by the compiler, but by the Android build system. It automatically adds $(LOCAL_PATH), $(intermediate), ... to the include paths.

Indeed. Same goes for the Automake build. Unless there are bigger fish to fry, will update it before pushing.

Thanks for spotting this thinko.
Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

PATCH 4/5 android: remove LOCAL_COPY_HEADERS* variables

In reply to Emil Velikov

With earlier changes we've implicitly add the relevant directories to the includes list, via LOCAL_EXPORT_C_INCLUDES_DIRS.

---
 freedreno/Android.mk | 3 ---
 intel/Android.mk     | 3 ---
 libkms/Android.mk    | 3 ---
 nouveau/Android.mk   | 3 ---
 radeon/Android.mk    | 3 ---
 5 files changed, 15 deletions(-)
freedreno/Android.mk +0 -3
index 9031d61..2645f73 100644
@@ -15,7 +15,4 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
-LOCAL_COPY_HEADERS := $(LIBDRM_FREEDRENO_H_FILES)
-LOCAL_COPY_HEADERS_TO := freedreno
-
 include $(BUILD_SHARED_LIBRARY)
intel/Android.mk +0 -3
index 7397110..0f498ec 100644
@@ -39,9 +39,6 @@ LOCAL_C_INCLUDES := \
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
-LOCAL_COPY_HEADERS := $(LIBDRM_INTEL_H_FILES)
-LOCAL_COPY_HEADERS_TO := libdrm
-
 LOCAL_SHARED_LIBRARIES := \
 	libdrm \
 	libpciaccess
libkms/Android.mk +0 -3
index 3c400de..12cf844 100644
@@ -47,7 +47,4 @@ LOCAL_SHARED_LIBRARIES := libdrm
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 
-LOCAL_COPY_HEADERS_TO := libdrm
-LOCAL_COPY_HEADERS := $(LIBKMS_H_FILES)
-
 include $(BUILD_SHARED_LIBRARY)
nouveau/Android.mk +0 -3
index 5bc325c..abc6aef 100644
@@ -15,7 +15,4 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
-LOCAL_COPY_HEADERS := $(LIBDRM_NOUVEAU_H_FILES)
-LOCAL_COPY_HEADERS_TO := libdrm
-
 include $(BUILD_SHARED_LIBRARY)
radeon/Android.mk +0 -3
index f12e631..ace3408 100644
@@ -15,7 +15,4 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
 
-LOCAL_COPY_HEADERS := $(LIBDRM_RADEON_H_FILES)
-LOCAL_COPY_HEADERS_TO := libdrm
-
 include $(BUILD_SHARED_LIBRARY)
Signature · 6 lines
2.1.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

PATCH 5/5 android: add the missing tag "optional" to libkms

In reply to Emil Velikov
---
 libkms/Android.mk | 1 +
 1 file changed, 1 insertion(+)
libkms/Android.mk +1 -0
index 12cf844..4f5e3d2 100644
@@ -43,6 +43,7 @@ LOCAL_SRC_FILES += $(LIBKMS_RADEON_FILES)
 endif
 
 LOCAL_MODULE := libkms
+LOCAL_MODULE_TAGS := optional
 LOCAL_SHARED_LIBRARIES := libdrm
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
Signature · 6 lines
2.1.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw
In reply to Emil Velikov

2015-03-18 7:30 GMT+08:00 Emil Velikov <[email protected]>:

Quoted 10 lines

As pointed out by Chih-Wei, Android's LOCAL_COPY_HEADERS{,_TO} has been depreciated for quite some time.

Although it was a convenient way of getting things done (no more hard-coding the location of drm) it seems that there is another more appropriate (and cleaner) solution. Namely:
Annotate the includes as "exported" and as the user selects the library for linking, the build will automatically add the includes.

Quoted 8 lines

Big thanks to Chih-Wei for the patience and persistence explaining the whole shebang. This series is mostly based on his patch in the Android-x86 tree, with some extra bits from your truly :-)

Chih-Wei,

I've tested this a few times already, although having someone with experience in the whole thing will be appreciated.

Thank you for the effort to clean it up.
The patches looks good to me.

I would suggest to remove all the use of LIBDRM_TOP. Do you want me to submit a patch?
_______________________________________________
dri-devel mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
Quoted 17 lines · Chih-Wei Huang

2015-03-18 7:30 GMT+08:00 Emil Velikov <[email protected]>:

Quoted 16 lines

As pointed out by Chih-Wei, Android's LOCAL_COPY_HEADERS{,_TO} has been depreciated for quite some time.

Although it was a convenient way of getting things done (no more hard-coding the location of drm) it seems that there is another more appropriate (and cleaner) solution. Namely:
Annotate the includes as "exported" and as the user selects the library for linking, the build will automatically add the includes.

Big thanks to Chih-Wei for the patience and persistence explaining the whole shebang. This series is mostly based on his patch in the Android-x86 tree, with some extra bits from your truly :-)

Chih-Wei,

Quoted 8 lines
Quoted 2 lines

I've tested this a few times already, although having someone with experience in the whole thing will be appreciated.

Thank you for the effort to clean it up.
The patches looks good to me.

I would suggest to remove all the use of LIBDRM_TOP. Do you want me to submit a patch?

Hmm I'm not sure that things will work correctly if we directly substitute LIBDRM_TOP with LOCAL_PATH within the following.

mkfiles := $(patsubst %,$(LIBDRM_TOP)/%/Android.mk,$(SUBDIRS))

Can you send a patch over ?

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

2015-03-18 9:37 GMT+08:00 Emil Velikov <[email protected]>:

Quoted 8 lines · Chih-Wei Huang
Quoted 3 lines

I would suggest to remove all the use of LIBDRM_TOP. Do you want me to submit a patch?

Hmm I'm not sure that things will work correctly if we directly substitute LIBDRM_TOP with LOCAL_PATH within the following.

mkfiles := $(patsubst %,$(LIBDRM_TOP)/%/Android.mk,$(SUBDIRS))

Sure. It works.
But I prefer to simplify it by android build system built-in functions. See the attached 0001-* patch.

0002-* removes LIBDRM_TOP entirely.

Quoted 1 line

Can you send a patch over ?

Signature · 3 lines
Chih-Wei
Android-x86 project
http://www.android-x86.org

From ade5c0b13db07303bd071bd076b275315414edb5 Mon Sep 17 00:00:00 2001
From: Chih-Wei Huang <[email protected]>
Date: Thu, 19 Mar 2015 00:17:33 +0800
Subject: [PATCH 1/2] android: simplify the including rule of subdirs

Use android build system functions to include Android.mk of subdirs.

---
 Android.mk       | 11 +----------
 tests/Android.mk |  1 +
 2 files changed, 2 insertions(+), 10 deletions(-)
 create mode 100644 tests/Android.mk
Android.mk +1 -10
index 0c78fc4..bad4fe1 100644
@@ -45,13 +45,4 @@ LOCAL_CFLAGS := \
 
 include $(BUILD_SHARED_LIBRARY)
 
-SUBDIRS := \
-	freedreno \
-	intel \
-	nouveau \
-	radeon \
-	libkms \
-	tests/modetest
-
-mkfiles := $(patsubst %,$(LIBDRM_TOP)/%/Android.mk,$(SUBDIRS))
-include $(mkfiles)
+include $(call all-makefiles-under,$(LOCAL_PATH))
tests/Android.mk new file +1 -0
new file mode 100644
index 0000000..5053e7d
@@ -0,0 +1 @@
+include $(call all-subdir-makefiles)
Signature · 1 line
1.9.1

From 93f7cc2ced4c7fdad0f0485c87b5db12cd98eddd Mon Sep 17 00:00:00 2001
From: Chih-Wei Huang <[email protected]>
Date: Thu, 19 Mar 2015 00:26:59 +0800
Subject: [PATCH 2/2] android: get rid of LIBDRM_TOP

---
 Android.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Android.mk +1 -3
index bad4fe1..7038c3c 100644
@@ -24,8 +24,6 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-LIBDRM_TOP := $(LOCAL_PATH)
-
 # Import variables LIBDRM_{,H_,INCLUDE_H_,INCLUDE_VMWGFX_H_}FILES
 include $(LOCAL_PATH)/Makefile.sources
 
@@ -38,7 +36,7 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
 	$(LOCAL_PATH)/include/drm
 
 LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP)/include/drm
+	$(LOCAL_PATH)/include/drm
 
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
Signature · 1 line
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
Quoted 8 lines · Chih-Wei Huang

2015-03-18 9:37 GMT+08:00 Emil Velikov <[email protected]>:

Quoted 7 lines
Quoted 7 lines · Chih-Wei Huang
Quoted 3 lines
Quoted 3 lines

I would suggest to remove all the use of LIBDRM_TOP. Do you want me to submit a patch?

Hmm I'm not sure that things will work correctly if we directly substitute LIBDRM_TOP with LOCAL_PATH within the following.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

mkfiles := $(patsubst %,$(LIBDRM_TOP)/%/Android.mk,$(SUBDIRS))

Sure. It works.
But I prefer to simplify it by android build system built-in functions. See the attached 0001-* patch.

0002-* removes LIBDRM_TOP entirely.

I realise that most people aren't too exited about Android, but for the future please try to use git send-email when sending patches to dri-devel or mesa-dev. I've included them below for posterity.

Patches look good imho. Just one question - when was the all-makefiles-under macro introduced ? I haven't seen it used too often.

Thanks,
Emil

Quoted 76 lines

0001-android-simplify-the-including-rule-of-subdirs.patch

From ade5c0b13db07303bd071bd076b275315414edb5 Mon Sep 17 00:00:00 2001
From: Chih-Wei Huang <[email protected]>
Date: Thu, 19 Mar 2015 00:17:33 +0800
Subject: [PATCH 1/2] android: simplify the including rule of subdirs

Use android build system functions to include Android.mk of subdirs.

---
 Android.mk       | 11 +----------
 tests/Android.mk |  1 +
 2 files changed, 2 insertions(+), 10 deletions(-)
 create mode 100644 tests/Android.mk
Android.mk +1 -10
index 0c78fc4..bad4fe1 100644
@@ -45,13 +45,4 @@ LOCAL_CFLAGS := \
 
 include $(BUILD_SHARED_LIBRARY)
 
-SUBDIRS := \
-	freedreno \
-	intel \
-	nouveau \
-	radeon \
-	libkms \
-	tests/modetest
-
-mkfiles := $(patsubst %,$(LIBDRM_TOP)/%/Android.mk,$(SUBDIRS))
-include $(mkfiles)
+include $(call all-makefiles-under,$(LOCAL_PATH))
tests/Android.mk new file +1 -1
new file mode 100644
index 0000000..5053e7d
@@ -0,0 +1 @@
+include $(call all-subdir-makefiles)
-- 1.9.1

0002-android-get-rid-of-LIBDRM_TOP.patch

From 93f7cc2ced4c7fdad0f0485c87b5db12cd98eddd Mon Sep 17 00:00:00 2001
From: Chih-Wei Huang <[email protected]>
Date: Thu, 19 Mar 2015 00:26:59 +0800
Subject: [PATCH 2/2] android: get rid of LIBDRM_TOP

---
 Android.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Android.mk +0 -2
index bad4fe1..7038c3c 100644
@@ -24,8 +24,6 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-LIBDRM_TOP := $(LOCAL_PATH)
-
 # Import variables LIBDRM_{,H_,INCLUDE_H_,INCLUDE_VMWGFX_H_}FILES
 include $(LOCAL_PATH)/Makefile.sources
 

Android.mk LOCAL_EXPORT_C_INCLUDE_DIRS := \

Quoted 9 lines
Android.mk +1 -2
@@ -38,7 +36,7 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
 	$(LOCAL_PATH)/include/drm
 
 LOCAL_C_INCLUDES := \
-	$(LIBDRM_TOP)/include/drm
+	$(LOCAL_PATH)/include/drm
 
 LOCAL_CFLAGS := \
 	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
-- 1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw

2015-03-19 10:06 GMT+08:00 Emil Velikov <[email protected]>:

Quoted 14 lines · Chih-Wei Huang
Quoted 13 lines

2015-03-18 9:37 GMT+08:00 Emil Velikov <[email protected]>:

Quoted 8 lines
Quoted 8 lines · Chih-Wei Huang
Quoted 3 lines
Quoted 3 lines

I would suggest to remove all the use of LIBDRM_TOP. Do you want me to submit a patch?

Hmm I'm not sure that things will work correctly if we directly substitute LIBDRM_TOP with LOCAL_PATH within the following.

mkfiles := $(patsubst %,$(LIBDRM_TOP)/%/Android.mk,$(SUBDIRS))

Sure. It works.
But I prefer to simplify it by android build system built-in functions. See the attached 0001-* patch.

Quoted 8 lines
Quoted 2 lines

0002-* removes LIBDRM_TOP entirely.

I realise that most people aren't too exited about Android, but for the future please try to use git send-email when sending patches to dri-devel or mesa-dev. I've included them below for posterity.

Patches look good imho. Just one question - when was the all-makefiles-under macro introduced ? I haven't seen it used too often.

It's introduced since very early day of android.
(git blame shows it's in commit 88b60799)

Personally I use it often.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw

Is there any gating item to prevent
these patches (5+2) from being merged?

2015-03-19 10:56 GMT+08:00 Chih-Wei Huang <[email protected]>:

Quoted 28 lines

2015-03-19 10:06 GMT+08:00 Emil Velikov <[email protected]>:

Quoted 14 lines · Chih-Wei Huang
Quoted 13 lines

2015-03-18 9:37 GMT+08:00 Emil Velikov <[email protected]>:

Quoted 8 lines
Quoted 8 lines · Chih-Wei Huang
Quoted 3 lines
Quoted 3 lines

I would suggest to remove all the use of LIBDRM_TOP. Do you want me to submit a patch?

Hmm I'm not sure that things will work correctly if we directly substitute LIBDRM_TOP with LOCAL_PATH within the following.

mkfiles := $(patsubst %,$(LIBDRM_TOP)/%/Android.mk,$(SUBDIRS))

Sure. It works.
But I prefer to simplify it by android build system built-in functions. See the attached 0001-* patch.

Quoted 8 lines
Quoted 2 lines

0002-* removes LIBDRM_TOP entirely.

I realise that most people aren't too exited about Android, but for the future please try to use git send-email when sending patches to dri-devel or mesa-dev. I've included them below for posterity.

Patches look good imho. Just one question - when was the all-makefiles-under macro introduced ? I haven't seen it used too often.

It's introduced since very early day of android.
(git blame shows it's in commit 88b60799)

Personally I use it often.

Signature · 7 lines
Chih-Wei
Android-x86 project
http://www.android-x86.org
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel