File tree Expand file tree Collapse file tree 7 files changed +110
-1
lines changed
Expand file tree Collapse file tree 7 files changed +110
-1
lines changed Original file line number Diff line number Diff line change 1+ AUTOMAKE_OPTIONS = foreign
2+
3+ CFLAGS = -Wall -pedantic
4+ include_HEADERS = bbexample.h
5+
6+ lib_LTLIBRARIES = libbbexample.la
7+ libbbexample_la_SOURCES = bbexamplelib.c
8+ libbbexample_la_LDFLAGS = -version-info 1:0:0
9+
10+ bin_PROGRAMS = bbexample
11+ bbexample_SOURCES = bbexample.c
12+ bbexample_LDADD = .libs/libbbexample.la
Original file line number Diff line number Diff line change 11bb-example
22==========
33
4- Yocto example recipe
4+ Example Yocto/OpenEmbedded autotooled recipe, building an executable with a depdency on a shared library
5+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ echo " Generating configure files... may take a while."
4+
5+ autoreconf --install --force && \
6+ echo " Preparing was successful if there was no error messages above." && \
7+ echo " Now type:" && \
8+ echo " ./configure && make" && \
9+ echo " Run './configure --help' for more information"
Original file line number Diff line number Diff line change 1+ #include <stdio.h>
2+ #include <stdlib.h>
3+ #include <stdio.h>
4+ #include <stdlib.h>
5+ #include <stdint.h>
6+ #include <string.h>
7+ #include <unistd.h>
8+
9+ #include "bbexample.h"
10+
11+ int main (int argc , char * argv [])
12+ {
13+ printf ("Hello Yocto World...\n" );
14+
15+ LibHelloWorld ();
16+
17+ return 0 ;
18+ }
19+
20+
21+
22+
23+
Original file line number Diff line number Diff line change 1+ #ifndef BB_EXAMPLE_H
2+ #define BB_EXAMPLE_H
3+
4+ /* Some cross-platform definitions generated by autotools */
5+ #if HAVE_CONFIG_H
6+ # include <config.h>
7+ #endif /* HAVE_CONFIG_H */
8+
9+ /*
10+ * Example function
11+ */
12+ extern void LibHelloWorld (void );
13+
14+ #endif /* BB_EXAMPLE_H */
Original file line number Diff line number Diff line change 1+ #include <stdlib.h>
2+ #include <stdio.h>
3+ #include <stdint.h>
4+ #include <string.h>
5+ #include <unistd.h>
6+ #include <errno.h>
7+ #include <string.h>
8+ #include <unistd.h>
9+ #include <linux/i2c-dev.h>
10+ #include <sys/ioctl.h>
11+ #include <sys/types.h>
12+ #include <sys/stat.h>
13+ #include <fcntl.h>
14+
15+ #include "bbexample.h"
16+
17+ void LibHelloWorld ()
18+ {
19+ printf ("Hello World (from a shared library!)\n" );
20+ }
Original file line number Diff line number Diff line change 1+ # -*- Autoconf -*-
2+ # Process this file with autoconf to produce a configure script.
3+
4+ # AC_PREREQ(2.60)
5+ AC_INIT ( bbexample , 0.1 , ajlennon@dynamicdevices.co.uk )
6+ AC_CONFIG_SRCDIR ( [ bbexample.c] )
7+ AC_CONFIG_HEADER([ config.h] )
8+ AM_INIT_AUTOMAKE ( bbexample , main )
9+
10+ # Checks for programs.
11+ AC_PROG_CC
12+ AC_PROG_INSTALL
13+ AC_PROG_MAKE_SET
14+
15+ # Checks for libraries.
16+ AM_PROG_LIBTOOL
17+
18+ # Set shared libraries
19+ AC_DISABLE_STATIC
20+ AC_ENABLE_SHARED
21+
22+ # Checks for header files.
23+
24+ # Checks for typedefs, structures, and compiler characteristics.
25+
26+ # Checks for library functions.
27+
28+ # AC_CONFIG_MACRO_DIR([m4])
29+ AC_CONFIG_FILES ( [ Makefile] )
30+ AC_OUTPUT
You can’t perform that action at this time.
0 commit comments