lib: Add initial automake build related files
authorSuman Anna <s-anna@ti.com>
Fri, 16 Oct 2020 21:26:47 +0000 (16:26 -0500)
committerSuman Anna <s-anna@ti.com>
Fri, 16 Oct 2020 22:23:44 +0000 (17:23 -0500)
Add various automake build related files to be able to build
and install the library. The library uses the version number
0.1.0.

Signed-off-by: Suman Anna <s-anna@ti.com>
Makefile.am [new file with mode: 0644]
configure.ac [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/ti_rpmsg_char.pc.in [new file with mode: 0644]

diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..af437a6
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..227c442
--- /dev/null
@@ -0,0 +1,68 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+
+# Initilize autoconf
+AC_INIT([ti-rpmsg-char], [0.1.0], [s-anna@ti.com])
+
+# Check common src files to ensure integrity of the package
+AC_CONFIG_SRCDIR([src/rpmsg_char.c])
+AC_CONFIG_HEADERS([config.h])
+
+# Set auxiliary build tools directories
+AC_CONFIG_AUX_DIR([build-aux])
+
+# Initialize automake
+AM_INIT_AUTOMAKE([foreign])
+
+# Disabling maintainer mode to prevent rebuild of configure script
+AM_MAINTAINER_MODE([disable])
+
+# Initialize libtool
+AC_PROG_LIBTOOL
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_CHECK_HEADER_STDBOOL
+AC_TYPE_SIZE_T
+AC_TYPE_UINT32_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([memset realpath strerror strtol])
+
+# Export CFLAGS and LDFLAGS to Makefile(s)
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_LDFLAGS])
+
+
+# Generate Makefile(s)
+AC_CONFIG_FILES([Makefile
+                 src/Makefile
+                 src/ti_rpmsg_char.pc])
+AC_OUTPUT
+
+echo \
+"-----------------------------------------------------------
+
+Thank you for installing the Linux ${PACKAGE_NAME} package
+
+Installation directory prefix: '${prefix}'.
+Compilation command: '${CC} ${CFLAGS} ${CPPFLAGS}'
+
+Now type 'make; sudo make install' to generate the program
+and install it to your system. sudo usage is optional and
+depends on the permissions of the prefix folder being used
+or installation.
+
+------------------------------------------------------------"
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..68c5ffc
--- /dev/null
@@ -0,0 +1,11 @@
+lib_LTLIBRARIES = libti_rpmsg_char.la
+
+include_HEADERS = \
+               $(top_srcdir)/include/ti_rpmsg_char.h \
+               $(top_srcdir)/include/rproc_id.h
+
+libti_rpmsg_char_la_SOURCES = rpmsg_char.c soc.c utils.c
+
+libti_rpmsg_char_la_CFLAGS = -I$(top_srcdir)/include
+
+libti_rpmsg_char_la_LDFLAGS = -version-number 0:1:0 -no-undefined
diff --git a/src/ti_rpmsg_char.pc.in b/src/ti_rpmsg_char.pc.in
new file mode 100644 (file)
index 0000000..6229091
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: ti-rpmsg-char
+Description: TI RPMsg Char utility library
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lti_rpmsg_char
+Cflags: -I${includedir}