All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] can-utils: cleanup headers
@ 2012-03-20  9:47 yegorslists
  2012-03-20  9:47 ` [PATCH 2/2] can-utils: add Makefile for Android build system yegorslists
  2012-03-20 10:10 ` [PATCH 1/2] can-utils: cleanup headers Marc Kleine-Budde
  0 siblings, 2 replies; 6+ messages in thread
From: yegorslists @ 2012-03-20  9:47 UTC (permalink / raw)
  To: linux-can; +Cc: Yegor Yefremov

From: Yegor Yefremov <yegorslists@googlemail.com>

- add missing sys/socket.h: on some systems (like Android)
have SOCK_RAW definition directly in sys/socket.h

- use sys/wait.h instead if wait.h

- include termios.h explicitly (Android)

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 canlogserver.c |    2 +-
 canplayer.c    |    1 +
 cansend.c      |    1 +
 slcan_attach.c |    2 ++
 slcand.c       |    5 +++--
 slcanpty.c     |    1 +
 6 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/canlogserver.c b/canlogserver.c
index b5a9d73..b6fa403 100644
--- a/canlogserver.c
+++ b/canlogserver.c
@@ -55,6 +55,7 @@
 #include <time.h>
 
 #include <sys/time.h>
+#include <sys/wait.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
@@ -65,7 +66,6 @@
 #include <linux/can.h>
 #include <linux/can/raw.h>
 #include <signal.h>
-#include <wait.h>
 #include <errno.h>
 
 #include "lib.h"
diff --git a/canplayer.c b/canplayer.c
index ff05f0f..b0b6333 100644
--- a/canplayer.c
+++ b/canplayer.c
@@ -53,6 +53,7 @@
 #include <unistd.h>
 
 #include <net/if.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <linux/can.h>
diff --git a/cansend.c b/cansend.c
index 5c71cfd..9be2163 100644
--- a/cansend.c
+++ b/cansend.c
@@ -52,6 +52,7 @@
 
 #include <net/if.h>
 #include <sys/ioctl.h>
+#include <sys/socket.h>
 
 #include <linux/can.h>
 #include <linux/can/raw.h>
diff --git a/slcan_attach.c b/slcan_attach.c
index b939a10..3d6846a 100644
--- a/slcan_attach.c
+++ b/slcan_attach.c
@@ -51,8 +51,10 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <getopt.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <net/if.h>
+#include <termios.h>
 
 #define LDISC_N_SLCAN 17 /* default slcan line discipline since Kernel 2.6.25 */
 
diff --git a/slcand.c b/slcand.c
index 334c718..2642405 100644
--- a/slcand.c
+++ b/slcand.c
@@ -44,14 +44,15 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <syslog.h>
 #include <errno.h>
 #include <pwd.h>
 #include <signal.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <net/if.h>
 
 /* default slcan line discipline since Kernel 2.6.25 */
diff --git a/slcanpty.c b/slcanpty.c
index ada6f3b..67dcf35 100644
--- a/slcanpty.c
+++ b/slcanpty.c
@@ -34,6 +34,7 @@
 #include <termios.h>
 
 #include <net/if.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-- 
1.7.7


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

* [PATCH 2/2] can-utils: add Makefile for Android build system
  2012-03-20  9:47 [PATCH 1/2] can-utils: cleanup headers yegorslists
@ 2012-03-20  9:47 ` yegorslists
  2012-03-20 10:08   ` Marc Kleine-Budde
  2012-03-20 10:10 ` [PATCH 1/2] can-utils: cleanup headers Marc Kleine-Budde
  1 sibling, 1 reply; 6+ messages in thread
From: yegorslists @ 2012-03-20  9:47 UTC (permalink / raw)
  To: linux-can; +Cc: Yegor Yefremov

From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 Android.mk |  329 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 329 insertions(+), 0 deletions(-)
 create mode 100644 Android.mk

diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..172ec2e
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,329 @@
+LOCAL_PATH := $(call my-dir)
+
+#
+# canlib
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := lib.c
+LOCAL_MODULE := libcan
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_STATIC_LIBRARY)
+
+#
+# candump
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := candump.c
+LOCAL_MODULE := candump
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := libcan
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# cansend
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := cansend.c
+LOCAL_MODULE := cansend
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := libcan
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# bcmserver
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := bcmserver.c
+LOCAL_MODULE := bcmserver
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+
+#
+# can-calc-bit-timing
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := can-calc-bit-timing.c
+LOCAL_MODULE := can-calc-bit-timing
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# canbusload
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := canbusload.c
+LOCAL_MODULE := canbusload
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# canfdtest
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := canfdtest.c
+LOCAL_MODULE := canfdtest
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# cangen
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := cangen.c
+LOCAL_MODULE := cangen
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := libcan
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# cangw
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := cangw.c
+LOCAL_MODULE := cangw
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# canlogserver
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := canlogserver.c
+LOCAL_MODULE := canlogserver
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := libcan
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# canplayer
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := canplayer.c
+LOCAL_MODULE := canplayer
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := libcan
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# cansniffer
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := cansniffer.c
+LOCAL_MODULE := cansniffer
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# isotpdump
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := isotpdump.c
+LOCAL_MODULE := isotpdump
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS) external/can-utils/include/
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# isotprecv
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := isotprecv.c
+LOCAL_MODULE := isotprecv
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS) external/can-utils/include/
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# isotpsend
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := isotpsend.c
+LOCAL_MODULE := isotpsend
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS) external/can-utils/include/
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# isotpserver
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := isotpserver.c
+LOCAL_MODULE := isotpserver
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS) external/can-utils/include/
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# isotpsniffer
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := isotpsniffer.c
+LOCAL_MODULE := isotpsniffer.c
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS) external/can-utils/include/
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# isotptun
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := isotptun.c
+LOCAL_MODULE := isotptun
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS) external/can-utils/include/
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# log2asc
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := log2asc.c
+LOCAL_MODULE := log2asc
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := libcan
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# log2long
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := log2long.c
+LOCAL_MODULE := log2long
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := libcan
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# slcan_attach
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := slcan_attach.c
+LOCAL_MODULE := slcan_attach
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# slcand
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := slcand.c
+LOCAL_MODULE := slcand
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
+
+#
+# slcanpty
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := slcanpty.c
+LOCAL_MODULE := slcanpty
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
+LOCAL_CFLAGS := -O2 -g -W -Wall 
+
+include $(BUILD_EXECUTABLE)
-- 
1.7.7


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

* Re: [PATCH 2/2] can-utils: add Makefile for Android build system
  2012-03-20  9:47 ` [PATCH 2/2] can-utils: add Makefile for Android build system yegorslists
@ 2012-03-20 10:08   ` Marc Kleine-Budde
  2012-03-22 10:15     ` Yegor Yefremov
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-03-20 10:08 UTC (permalink / raw)
  To: yegorslists; +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

On 03/20/2012 10:47 AM, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Looks a bit ugly to me (as a non Android developer) repeating some
variables so many times. Is it usual to write android makefiles like this?

There are some trailing whitespaces. No need to recommit the patch, I've
removed them.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

* Re: [PATCH 1/2] can-utils: cleanup headers
  2012-03-20  9:47 [PATCH 1/2] can-utils: cleanup headers yegorslists
  2012-03-20  9:47 ` [PATCH 2/2] can-utils: add Makefile for Android build system yegorslists
@ 2012-03-20 10:10 ` Marc Kleine-Budde
  1 sibling, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-03-20 10:10 UTC (permalink / raw)
  To: yegorslists; +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 738 bytes --]

On 03/20/2012 10:47 AM, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> - add missing sys/socket.h: on some systems (like Android)
> have SOCK_RAW definition directly in sys/socket.h
> 
> - use sys/wait.h instead if wait.h
> 
> - include termios.h explicitly (Android)
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

It sill compiles under plain Linux. Thanks, applied to master.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

* Re: [PATCH 2/2] can-utils: add Makefile for Android build system
  2012-03-20 10:08   ` Marc Kleine-Budde
@ 2012-03-22 10:15     ` Yegor Yefremov
  2012-03-22 10:51       ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Yegor Yefremov @ 2012-03-22 10:15 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: yegorslists, linux-can

Am 20.03.2012 11:08, schrieb Marc Kleine-Budde:
> On 03/20/2012 10:47 AM, yegorslists@googlemail.com wrote:
>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>
>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Looks a bit ugly to me (as a non Android developer) repeating some
> variables so many times. Is it usual to write android makefiles like this?

Yes, it is really ugly :-( I'd like Android to have Buildroot like build system, so that native autotools/cmake/ etc. could be used directly. I've looked at other external packages in Android and took their Android.mk as a template.
 
> There are some trailing whitespaces. No need to recommit the patch, I've
> removed them.

Working with quilt was easier regarding trailing white spaces. I'm looking for git way of removing them.

I've seen the first patch committed, this is one is still not committed as far as I can see. Do I need to rework something?

Yegor


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

* Re: [PATCH 2/2] can-utils: add Makefile for Android build system
  2012-03-22 10:15     ` Yegor Yefremov
@ 2012-03-22 10:51       ` Marc Kleine-Budde
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-03-22 10:51 UTC (permalink / raw)
  To: yegor_sub1; +Cc: yegorslists, linux-can

[-- Attachment #1: Type: text/plain, Size: 1461 bytes --]

On 03/22/2012 11:15 AM, Yegor Yefremov wrote:
> Am 20.03.2012 11:08, schrieb Marc Kleine-Budde:
>> On 03/20/2012 10:47 AM, yegorslists@googlemail.com wrote:
>>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>>
>>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
>>
>> Looks a bit ugly to me (as a non Android developer) repeating some
>> variables so many times. Is it usual to write android makefiles like this?
> 
> Yes, it is really ugly :-( I'd like Android to have Buildroot like
> build system, so that native autotools/cmake/ etc. could be used
> directly. I've looked at other external packages in Android and took
> their Android.mk as a template.

Okay...seems you know what you're doing :)

>> There are some trailing whitespaces. No need to recommit the patch, I've
>> removed them.
> 
> Working with quilt was easier regarding trailing white spaces. I'm
> looking for git way of removing them.
> 
> I've seen the first patch committed, this is one is still not
> committed as far as I can see. Do I need to rework something?

No - I just wanted to have a statement on the ugliness :) I'll commit
the patch now.

Thanks, Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

end of thread, other threads:[~2012-03-22 10:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-20  9:47 [PATCH 1/2] can-utils: cleanup headers yegorslists
2012-03-20  9:47 ` [PATCH 2/2] can-utils: add Makefile for Android build system yegorslists
2012-03-20 10:08   ` Marc Kleine-Budde
2012-03-22 10:15     ` Yegor Yefremov
2012-03-22 10:51       ` Marc Kleine-Budde
2012-03-20 10:10 ` [PATCH 1/2] can-utils: cleanup headers Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.