From 0fdc91bfba90d63c967251b3a9ff6bbbab1c96c6 Mon Sep 17 00:00:00 2001
From: Divya Theja <divyathe@codeaurora.org>
Date: Mon, 5 Feb 2018 16:54:16 +0530
Subject: [PATCH] Add autotool make files for libcrypto_utils

---
 Makefile.am           | 32 ++++++++++++++++++++++++++++++++
 configure.ac          | 32 ++++++++++++++++++++++++++++++++
 libcrypto_utils.pc.in | 11 +++++++++++
 3 files changed, 75 insertions(+)
 create mode 100644 Makefile.am
 create mode 100644 configure.ac
 create mode 100644 libcrypto_utils.pc.in

diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..8247f50
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,32 @@
+AM_CFLAGS := -Wall \
+             -Wextra \
+             -Wno-error=implicit-function-declaration\
+             -std=c99
+
+EXTRA_CFLAGS := -I$(srcdir)/include\
+                -I@H@
+
+ACLOCAL_AMFLAGS = -I m4
+
+### Making the shared library
+
+libcrypto_utils_c_sources = android_pubkey.c
+libcrypto_utils_h_sources = include/crypto_utils/android_pubkey.h
+
+libcrypto_utils_la_SOURCES = $(libcrypto_utils_c_sources)
+
+libcrypto_utils_la_CFLAGS = $(AM_CFLAGS)
+libcrypto_utils_la_CFLAGS += $(EXTRA_CFLAGS)
+
+####export the library and provide the pkg config data
+lib_LTLIBRARIES = libcrypto_utils.la
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libcrypto_utils.pc
+EXTRA_DIST = $(pkgconfig_DATA)
+
+### exporting headers
+crypto_utils_includedir = $(includedir)/crypto_utils
+crypto_utils_include_HEADERS = $(libcrypto_utils_h_sources)
+
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..27871f7
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,32 @@
+  AC_PREREQ(2.61)
+
+  AC_INIT([libcrypto_utils],1.0.0)
+
+  AM_INIT_AUTOMAKE([-Wall gnu foreign])
+  AC_CONFIG_SRCDIR([Makefile.am])
+  AC_CONFIG_HEADER([config.h])
+  AC_CONFIG_MACRO_DIR([m4])
+
+  # Checks for programs.
+  AM_PROG_AS
+  AC_PROG_CC
+  AM_PROG_CC_C_O
+  AC_PROG_LIBTOOL
+  AC_PROG_AWK
+  AC_PROG_CPP
+  AC_PROG_CXX
+  AC_PROG_INSTALL
+  AC_PROG_LN_S
+  AC_PROG_MAKE_SET
+  PKG_PROG_PKG_CONFIG
+
+  AC_ARG_WITH([header_includes],AC_HELP_STRING([--with-header-includes=@<:@dir@:>@],[Specify the location of the included headers]),[header_incdir=$withval],[with_header_includes=no])
+  if test "x$with_header_includes" != "xno"; then
+    AC_SUBST(H,[${header_incdir}])
+  fi
+
+ AC_OUTPUT([ \
+          Makefile \
+          libcrypto_utils.pc
+  ])
+
diff --git a/libcrypto_utils.pc.in b/libcrypto_utils.pc.in
new file mode 100644
index 0000000..56f1a54
--- /dev/null
+++ b/libcrypto_utils.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: crypto_utils
+Description: crypto_utils library
+Version: @VERSION@
+Libs: -L${libdir} -lcrypto_utils
+Cflags: -I${includedir}/crypto_utils
+
-- 
1.9.1

