From 9b96af402f8ed256c5db1e8c48da6c1d5f5f92d8 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 29 Aug 2014 15:30:03 +0200 Subject: yocto: add autotools hello world example Signed-off-by: Manuel Traut --- .../recipes-hello/autohello/autohello_1.0.bb | 9 +++++++ .../autohello/files/autohello-1.0.tar.gz | Bin 0 -> 91394 bytes .../autohello/files/autohello/AUTHORS | 0 .../autohello/files/autohello/ChangeLog | 0 .../autohello/files/autohello/Makefile.am | 2 ++ .../recipes-hello/autohello/files/autohello/NEWS | 0 .../recipes-hello/autohello/files/autohello/README | 0 .../autohello/files/autohello/autogen.sh | 2 ++ .../autohello/files/autohello/autohello.c | 12 +++++++++ .../autohello/files/autohello/configure.ac | 21 +++++++++++++++ .../yocto-advanced/pres_yocto-advanced.tex | 30 +++++++++++++++++++++ 11 files changed, 76 insertions(+) create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/autohello_1.0.bb create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello-1.0.tar.gz create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/AUTHORS create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/ChangeLog create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/Makefile.am create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/NEWS create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/README create mode 100755 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/autogen.sh create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/autohello.c create mode 100644 distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/configure.ac diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/autohello_1.0.bb b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/autohello_1.0.bb new file mode 100644 index 0000000..e9c79f9 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/autohello_1.0.bb @@ -0,0 +1,9 @@ +DESCRIPTION = "GNU Helloworld application" +SECTION = "examples" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" +PR = "r0" + +SRC_URI = "file://autohello-${PV}.tar.gz" +SRC_URI[md5sum] = "4bfc9bed4d5d67a266d93e99e5883211" +inherit autotools diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello-1.0.tar.gz b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello-1.0.tar.gz new file mode 100644 index 0000000..424b53c Binary files /dev/null and b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello-1.0.tar.gz differ diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/AUTHORS b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/ChangeLog b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/Makefile.am b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/Makefile.am new file mode 100644 index 0000000..1b344bc --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/Makefile.am @@ -0,0 +1,2 @@ +bin_PROGRAMS = autohello +autohello_SOURCES = autohello.c diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/NEWS b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/README b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/README new file mode 100644 index 0000000..e69de29 diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/autogen.sh b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/autogen.sh new file mode 100755 index 0000000..9088512 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/autogen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +autoreconf -sif diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/autohello.c b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/autohello.c new file mode 100644 index 0000000..d035085 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/autohello.c @@ -0,0 +1,12 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int main (int argc, char **argv) +{ + printf ("autohello poky world\n"); + + return 0; +} diff --git a/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/configure.ac b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/configure.ac new file mode 100644 index 0000000..1ac5db3 --- /dev/null +++ b/distribution/yocto-advanced/poky/meta-linutronix/recipes-hello/autohello/files/autohello/configure.ac @@ -0,0 +1,21 @@ +AC_PREREQ([2.69]) +AC_INIT([autohello], [1.0], [maunt@linutronix.de]) +AM_INIT_AUTOMAKE([silent-rules]) +AC_CONFIG_SRCDIR([autohello.c]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL +AM_PROG_CC_C_O + +# Checks for libraries. + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/distribution/yocto-advanced/pres_yocto-advanced.tex b/distribution/yocto-advanced/pres_yocto-advanced.tex index faa513d..56ea3d4 100644 --- a/distribution/yocto-advanced/pres_yocto-advanced.tex +++ b/distribution/yocto-advanced/pres_yocto-advanced.tex @@ -650,6 +650,8 @@ PREFERRED\_VERSION\_virtual/kernel = "3.16" \item look for a similar recipe \item proper bbclass available? \end{itemize} +on the next slides, we have a look what is useful for very simple applications, +autotools and cmake based projects and qt applications. \end{frame} \begin{frame}[fragile] @@ -688,6 +690,34 @@ do_install() { \end{verbatim} \end{frame} +\begin{frame}[fragile] +\frametitle{autools based project} +\begin{verbatim} +├── autohello_1.0.bb +└── files + └── autohello-1.0.tar.gz +\end{verbatim} +\pause +\begin{verbatim} +DESCRIPTION = "GNU Helloworld application" +SECTION = "examples" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" +PR = "r0" + +SRC_URI = "file://autohello-${PV}.tar.gz" +SRC_URI[md5sum] = "4bfc9bed4d5d67a266d93e99e5883211" +inherit autotools +\end{verbatim} +\end{frame} + +\begin{frame} +\frametitle{cmake based project} +\end{frame} + +\begin{frame} +\frametitle{qt application} +\end{frame} \begin{frame} \frametitle{use PR Service} -- cgit v1.2.3