[lxc-devel] [libresource/master] Adding libtool make infrastructure

rahuyada on Github lxc-bot at linuxcontainers.org
Fri Aug 9 19:07:09 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 416 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190809/bc8578af/attachment.bin>
-------------- next part --------------
From 26272a2528e8c298ac6291e876f7224d94902178 Mon Sep 17 00:00:00 2001
From: Rahul Yadav <rahul.x.yadav at oracle.com>
Date: Fri, 9 Aug 2019 12:03:26 -0700
Subject: [PATCH] Adding libtool make infrastructure

Signed-off-by: Rahul Yadav <rahul.x.yadav at oracle.com>
---
 Makefile     | 22 ----------------------
 Makefile.am  | 38 ++++++++++++++++++++++++++++++++++++++
 configure.ac | 37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+), 22 deletions(-)
 delete mode 100644 Makefile
 create mode 100644 Makefile.am
 create mode 100644 configure.ac

diff --git a/Makefile b/Makefile
deleted file mode 100644
index fd3b897..0000000
--- a/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-CC = gcc
-CFLAGS = -g -Wall -Werror -fPIC
-DEPS = resource.h res_impl.h resmem.h resnet.h resproc.h
-OBJ = resource.o resmem.o resnet.o resproc.o
-TEST = test
-RM = rm -rf
-CP = cp
-ABI_MAJOR=0
-ABI_MINOR=1
-ABI_MICRO=1
-ABI=$(ABI_MAJOR).$(ABI_MINOR).$(ABI_MICRO)
-LIB = libresource.so.$(ABI)
-
-%.o: %.c $(DEPS)
-	$(CC) -c -o $@ $< $(CFLAGS)
-
-all: $(OBJ)
-	$(CC) -shared -Wl,-soname,libresource.so.$(ABI_MAJOR) -o $(LIB) $^ $(CFLAGS)
-
-.PHONY : clean
-clean:
-	$(RM) $(LIB) $(OBJ) $(TEST)
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..70ad54b
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,38 @@
+# Copyright (C) 2018, Oracle and/or its affiliates. All rights reserved
+#
+# This file is part of libresource.
+#
+# libresource is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# libresource is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with libresource. If not, see <http://www.gnu.org/licenses/>.
+#
+# This is main file which is starting point to all interfaces provided
+# with libresource.
+
+ACLOCAL_AMFLAGS = -I m4
+
+EXTRA_DIST = CONTRIBUTORS.md README.md
+
+include_HEADERS = resource.h
+
+noinst_HEADERS = resource_impl.h resmem.h resnet.h resproc.h
+
+lib_LTLIBRARIES = libresource.la
+
+SOURCES_ALL = \
+	resource.c resmem.c resnet.c resproc.c \
+	resource.h resource_impl.h resmem.h resnet.h resproc.h
+
+libresource_la_SOURCES = ${SOURCES_ALL}
+libresource_la_CFLAGS = ${AM_CFLAGS}
+libresource_la_LDFLAGS = -version-number \
+	$(VERSION_MAJOR):$(VERSION_MINOR):$(VERSION_MICRO)
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..f093477
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,37 @@
+# Copyright (C) 2018, Oracle and/or its affiliates. All rights reserved
+#
+# This file is part of libresource.
+#
+# libresource is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# libresource is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with libresource. If not, see <http://www.gnu.org/licenses/>.
+#
+# This is main file which is starting point to all interfaces provided
+# with libresource.
+
+AC_INIT([libresource], [0.1.1])
+LT_INIT([shared])
+AM_INIT_AUTOMAKE(foreign)
+AM_INIT_AUTOMAKE
+AC_DISABLE_STATIC
+AC_PROG_CC
+AC_PROG_CC_STDC
+AM_CFLAGS="-g -Wall -Werror -fPIC"
+AC_CHECK_HEADERS_ONCE([linux/resource.h])
+VERSION_MAJOR=0
+VERSION_MINOR=1
+VERSION_MICRO=1
+AC_SUBST([VERSION_MAJOR])
+AC_SUBST([VERSION_MINOR])
+AC_SUBST([VERSION_MICRO])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT


More information about the lxc-devel mailing list