From 9f06f7700460e58499dcf041f22972d6eba42f46 Mon Sep 17 00:00:00 2001 From: Carsten Schoenert Date: Sun, 11 Jan 2015 19:37:35 +0100 Subject: [PATCH] adding basic files for build environment creation Start adding basic files for generating all the needed files to create a working build environment by the autotools. By this currently only the shared library of libcoap is build. There is no API version implemented! This has to be done later. --- COPYING | 6 ++++++ Makefile.am | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ NEWS | 0 README | 1 + autogen.sh | 36 ++++++++++++++++++++++++++++++++++++ configure.ac | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 143 insertions(+) create mode 100644 COPYING create mode 100644 Makefile.am create mode 100644 NEWS create mode 120000 README create mode 100755 autogen.sh create mode 100644 configure.ac diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..d28b1e74 --- /dev/null +++ b/COPYING @@ -0,0 +1,6 @@ +libcoap is published as open-source software without any warranty of any kind. + +Use is permitted under the terms of the GNU General Public License (GPL), +Version 2 or higher, OR the revised BSD license. + +The respective license file are shipped as LICENSE.BSD and LICENSE.GPL. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..2a8bc4bb --- /dev/null +++ b/Makefile.am @@ -0,0 +1,52 @@ +# Makefile.am for libcoap +# +# Copyright (C) 2010-2015 Olaf Bergmann +# (C) 2015 Carsten Schoenert +# +# This file is part of the CoAP C library libcoap. Please see README and +# COPYING for terms of use. + +## Place generated object files (.o) into the same directory as their source +## files, in order to avoid collisions when non-recursive make is used. +AUTOMAKE_OPTIONS = subdir-objects + +ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 + +## default CFLAGS +DEFAULT_CFLAGS = -D_GNU_SOURCE -DWITH_POSIX -Wall -Wextra -Wunused -Wunused-result -Wlogical-op -Winline -Wswitch-default -Wswitch-enum -fPIC -pedantic -Wformat -Wformat-security -fPIE -pie + +AM_CFLAGS = -I @top_builddir@/include/coap/ $(DEFAULT_CFLAGS) -std=c99 + +## The libtool archive file (.la) will be installed into the directory named +## by the predefined variable $(bindir), along with the actual shared library +## file (.so). +lib_LTLIBRARIES = libcoap.la + +## Define the source file list for the "libcoap.la" target. +## Note that it is not necessary to list header files which are already listed +## elsewhere in a _HEADERS variable assignment. +libcoap_la_SOURCES = \ + src/async.c \ + src/block.c \ + src/coap_io.c \ + src/debug.c \ + src/encode.c \ + src/hashkey.c \ + src/mem.c \ + src/net.c \ + src/option.c \ + src/pdu.c \ + src/resource.c \ + src/str.c \ + src/subscribe.c \ + src/uri.c + +## Instruct libtool to add the library version '0.0.0' into the shared library +## file (.so). This will be changed later to a substituted version via variables. +libcoap_la_LDFLAGS = -version-info 0 + +## Define an independent executable script for inclusion in the distribution +## archive. However, it will not be installed on an end user's system due to +## the noinst_ prefix. +dist_noinst_SCRIPTS = autogen.sh + diff --git a/NEWS b/NEWS new file mode 100644 index 00000000..e69de29b diff --git a/README b/README new file mode 120000 index 00000000..42061c01 --- /dev/null +++ b/README @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 00000000..3e289859 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,36 @@ +#!/bin/sh -e + +PROJECT="libcoap" + +AUTOGEN_FILES="INSTALL \ + aclocal.m4 ar-lib \ + coap_config.h coap_config.h.in* compile config.guess config.h* config.log config.status config.sub configure \ + depcomp \ + install-sh \ + libtool ltmain.sh \ + missing \ + Makefile Makefile.in \ + stamp-h1 src/.dirstamp libcoap*.la* src/*.lo" + +AUTOGEN_DIRS=".deps .libs autom4te.cache/ m4/ src/.libs/ src/.deps/" + +if [ "$1" = "--clean" ]; then + echo "removing autogerated files ..." + rm -rf $AUTOGEN_FILES $AUTOGEN_DIRS + echo "done" + exit +else + echo "[HINT] You can run 'autogen.sh --clean' to remove all generated files by the autotools." + echo +fi + +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. + +echo "Generating needed autotools files for $PROJECT by running autoreconf ..." +autoreconf --force --install --verbose "$srcdir" + +echo +echo "You can now run 'configure --help' to see possible configuration options." +echo "Otherwise process the configure script to create the makefiles and generated helper files." +echo diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..179e1c11 --- /dev/null +++ b/configure.ac @@ -0,0 +1,48 @@ +# configure.ac for the libcoap package +# +# Copyright (C) 2010-2015 Olaf Bergmann +# (C) 2015 Carsten Schoenert +# +# Please run 'autogen.sh' to let autoconf produce a configure script. + +AC_INIT([libcoap], [4.1.2], [libcoap-developers@lists.sourceforge.net], [libcoap], [http://libcoap.sourceforge.net/]) +AC_PREREQ([2.59]) +AM_INIT_AUTOMAKE([1.10 -Wall no-define]) + +# Generate one configuration header file for building the library itself with +# an autogenerated template. We need later a second one (include/libcoap.h) +# that will be installed alongside the library. +AC_CONFIG_HEADERS([coap_config.h]) + +AC_PROG_CC +AM_PROG_AR +AC_CONFIG_MACRO_DIR([m4]) +LT_INIT([disable-static]) + +# Check for needed additional programs +# FIXME! Switch to configure section? +AC_PATH_PROG(DOXYGEN, doxygen, [:]) + +# Checks for header files. +AC_CHECK_HEADERS([assert.h arpa/inet.h limits.h netdb.h netinet/in.h \ + stdlib.h string.h strings.h sys/socket.h sys/time.h \ + time.h unistd.h sys/unistd.h syslog.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T + +# Checks for library functions. +AC_FUNC_MALLOC +AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo \ + strnlen]) + +# Override the various template files, currently just one makefile. +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT + +AC_MSG_RESULT([ +libcoap configuration summary: + libcoap package version : 4.1.2 +]);