Skip to content

Commit

Permalink
autotools added for building ksmppd
Browse files Browse the repository at this point in the history
  • Loading branch information
rajesh6115 committed Jul 9, 2018
1 parent ef2d10b commit 242377f
Show file tree
Hide file tree
Showing 11 changed files with 1,155 additions and 73 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,26 @@ smpp/libsmpp/*.o
CMakeLists.txt
*.a
.idea
*.lo
*.o
smpp/.libs
smpp/.deps
m4/
autom4te.cache/
build-aux/
Makefile
Makefile.in
smpp/Makefile
smpp/Makefile.in
configure
config.h
config.h.in
config.log
config.status
libtool
smpp/libsmpp.la
smpp/libsmpp/.libs
smpp/libsmpp/.deps
smpp/libsmpp/.dirstamp
aclocal.m4
stamp-h1
Empty file added AUTHORS
Empty file.
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

Empty file added ChangeLog
Empty file.
368 changes: 368 additions & 0 deletions INSTALL

Large diffs are not rendered by default.

73 changes: 0 additions & 73 deletions Makefile

This file was deleted.

2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = smpp
Empty file added NEWS
Empty file.
Empty file added README
Empty file.
73 changes: 73 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Autoconf Minimum Version Required Check
AC_PREREQ([2.68])
# Initilise Autoconf with project Name and Version Details
AC_INIT([ksmppd], [1.4.4], [kneodev@gmail.com], [ksmppd], [https://github.com/kneodev/ksmppd])
# Put autotools auxiliary files in a subdir, so they don't clutter top dir:
AC_CONFIG_AUX_DIR([build-aux])
# Initialise Automake with Default version Number and Default CPP flags
AM_INIT_AUTOMAKE([1.11 -Wall -Werror subdir-objects])
# Check for some Unique file in the Project
AC_CONFIG_SRCDIR([smpp/])
# Check for C Compiler
AC_PROG_CC
AC_PROG_CC_C99
# config.h will be created and default header
AC_CONFIG_HEADERS([config.h])
# all Macro in this folder
AC_CONFIG_MACRO_DIR([m4])
# AR required to create static library
AM_PROG_AR
# Silence warning: ar: 'u' modifier ignored since 'D' is the default
AC_SUBST(AR_FLAGS, [cr])
# libtool Required
LT_PREREQ([2.2])
LT_INIT([dlopen])
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
# Check of library created using ranlib
#AC_PROG_RANLIB
AC_ENABLE_SHARED
# Check for pthread
AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(ENABLE_THREADS, 1, [Define this to enable threads.])],[AC_MSG_ERROR([required library pthread missing])])
# libtool Required
LT_PREREQ([2.2])
LT_INIT([dlopen])
AC_ENABLE_SHARED
AC_PROG_LIBTOOL(libtool)
# check for libevent library
AC_MSG_NOTICE([Checking for libevent2 and its requirements.])
PKG_CHECK_MODULES([libevent], [libevent >= 2.0], with_libevent=yes, with_libevent=no)
if test "$with_libevent" == "no"
then
AC_MSG_ERROR([libevent library not found ])
exit 1
else
AC_DEFINE(WITH_LIBEVENT, 1 ,[libevent is Enabled])
fi

#check for shtool required to extract platform
AC_CHECK_PROG(SHTOOL_CHECK, shtool, yes)
if test x"$SHTOOL_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install shtool before installing.])
fi
PLATFORMINFO=`shtool platform -S "-" -F "%<ac>-%<sp>" --lower`
AC_DEFINE_UNQUOTED(PLATFORMINFO,"$PLATFORMINFO",[platform version])

AC_CHECK_PROG(GWCONFIG_CHECK, gw-config, yes)
if test x"$GWCONFIG_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install kannel gw-config before installing.])
fi
# define GIT_VERSION
AC_CHECK_PROG(GIT_CHECK, git, yes)
if test x"$GIT_CHECK" != x"yes" ; then
AC_MSG_ERROR([Please install git before installing.])
fi
GITVERSION=`git describe --always --tags`
AC_DEFINE_UNQUOTED(GITVERSION,"$GITVERSION",[git version])
# Generate These Files for Sucessfully Build
AC_CONFIG_FILES([
Makefile
smpp/Makefile
])
AC_OUTPUT

15 changes: 15 additions & 0 deletions smpp/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ACLOCAL_AMFLAGS = -I m4
noinst_LTLIBRARIES = libsmpp.la
libsmpp_la_SOURCES = \
libsmpp/smpp_bearerbox.c libsmpp/smpp_database_mysql.c libsmpp/smpp_http_client.c libsmpp/smpp_listener.c \
libsmpp/smpp_plugin.c libsmpp/smpp_queues.c libsmpp/smpp_server.c libsmpp/smpp_uuid.c libsmpp/smpp_database.c \
libsmpp/smpp_database.c libsmpp/smpp_esme.c libsmpp/smpp_http_server.c libsmpp/smpp_pdu_util.c libsmpp/smpp_queued_pdu.c \
libsmpp/smpp_route.c libsmpp/smpp_server_cfg.c
libsmpp_la_CPPFLAGS = -fPIC -I ${top_srcdir}/smpp/libsmpp ${libevent_CFLAGS} `gw-config --cflags`
libsmpp_la_LDFLAGS = `gw-config --libs` ${libevent_LIBS} -ldl

bin_PROGRAMS = ksmppd
ksmppd_SOURCES = ksmppd.c
ksmppd_CPPFLAGS = -I ${top_srcdir}/smpp/libsmpp `gw-config --cflags`
ksmppd_LDFLAGS = `gw-config --libs` ${libevent_LIBS} -ldl
ksmppd_LDADD= ${top_srcdir}/smpp/libsmpp.la ${libevent_LIBS}

0 comments on commit 242377f

Please sign in to comment.