1
0
mirror of https://github.com/obgm/libcoap.git synced 2025-10-14 02:19:34 +08:00

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.
This commit is contained in:
Carsten Schoenert
2015-01-11 19:37:35 +01:00
committed by Olaf Bergmann
parent cda3b72f25
commit 9f06f77004
6 changed files with 143 additions and 0 deletions

6
COPYING Normal file
View File

@@ -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.

52
Makefile.am Normal file
View File

@@ -0,0 +1,52 @@
# Makefile.am for libcoap
#
# Copyright (C) 2010-2015 Olaf Bergmann <bergmann@tzi.org>
# (C) 2015 Carsten Schoenert <c.schoenert@t-online.de>
#
# 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

0
NEWS Normal file
View File

1
README Symbolic link
View File

@@ -0,0 +1 @@
README.md

36
autogen.sh Executable file
View File

@@ -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

48
configure.ac Normal file
View File

@@ -0,0 +1,48 @@
# configure.ac for the libcoap package
#
# Copyright (C) 2010-2015 Olaf Bergmann <bergmann@tzi.org>
# (C) 2015 Carsten Schoenert <c.schoenert@t-online.de>
#
# 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
]);