Skip to content

Commit

Permalink
autotools: Initial version
Browse files Browse the repository at this point in the history
Using autotools (autoreconf) to build SwSS project.

Usage:
  ./autogen.sh
  ./configure --prefix=out [--enable-debug]
  make -j `nproc` && make install

Signed-off-by: Elad Raz <eladr@mellanox.com>
  • Loading branch information
eladraz committed Mar 6, 2016
1 parent 8f8760a commit 2427463
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
Empty file added Makefile.am
Empty file.
13 changes: 13 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if [ `uname` == "Darwin" ]; then
LIBTOOLIZE=glibtoolize
else
LIBTOOLIZE=libtoolize
fi

touch NEWS README AUTHORS COPYING ChangeLog
$LIBTOOLIZE --force --copy &&
autoreconf --force --install -I m4
rm -Rf autom4te.cache

5 changes: 5 additions & 0 deletions config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

32 changes: 32 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
AC_INIT([sonic-swss],[1.0])
AC_CONFIG_SRCDIR([])
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE
AC_LANG_C
AC_LANG([C++])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_HEADER_STDC

AC_CHECK_LIB([hiredis], [redisConnect])
AC_CHECK_LIB([nl-genl-3], [genl_connect])

AC_ARG_ENABLE(debug,
[ --enable-debug Compile with debugging flags],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],[debug=false])
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)

CFLAGS_COMMON="-std=c++11 -Wall -fPIC -Wno-write-strings -I/usr/include/libnl3"
AC_SUBST(CFLAGS_COMMON)

AC_CONFIG_FILES([
Makefile
])

AC_OUTPUT
5 changes: 5 additions & 0 deletions m4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

0 comments on commit 2427463

Please sign in to comment.