configure.ac

Sat, 26 Apr 2014 22:53:10 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 26 Apr 2014 22:53:10 +0200
changeset 13
7f8432413321
parent 7
d74b26b2f217
child 16
f4cbe008da72
permissions
-rw-r--r--

Version 0.0.1, changed data topics to /raw tree

dnl Process this file with autoconf to produce a configure script.

AC_INIT(thermometers/main.c)
AM_CONFIG_HEADER(config.h)
SUBDIRS="lib thermometers"
AC_SUBST(SUBDIRS)

dnl General settings
dnl After changeing the version number, run autoconf!
PACKAGE="mbsePi-apps"
VERSION="0.0.1"
COPYRIGHT="Copyright (C) 2014 Michiel Broek, All Rights Reserved"
CYEARS="2014"
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(COPYRIGHT)
AC_SUBST(CYEARS)
AC_PREFIX_DEFAULT(/usr/local)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(COPYRIGHT, "$COPYRIGHT")
TARGET="$target"


dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
dnl Try to find GNU install
AC_CHECK_PROG(INSTALL, ginstall, ginstall)
AC_CHECK_PROG(INSTALL, install, install)
dnl AC_PROG_MAKE_SET
AC_CHECK_PROG(TAR, tar, tar)

#
# Libraries for mbsePi-apps
#
AC_CHECK_LIB(mosquitto,mosquitto_lib_init,result=yes,result=no)
if test "$result" = "yes"; then
  LIBS="$LIBS -lmosquitto"
else
  AC_MSG_ERROR(libmosquitto not found)
fi

#
# Additional commandline switches
#
AC_ARG_ENABLE(experiment,  [  --enable-experiment     Compile experimental code],     [ experiment=$enableval ], [ experiment=no ])
if test "$experiment" = "yes"; then
  AC_DEFINE(USE_EXPERIMENT)
fi

AC_ARG_ENABLE(debugging,   [  --enable-debugging      Compile for debugging], [ debugging=$enableval ], [ debugging=no ])
if test "$debugging" = "yes"; then
  CFLAGS="-O -g -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -Winline"    
else
  CFLAGS="-g -O2 -fomit-frame-pointer -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -Winline"
fi

dnl Checks for header files.
AC_HEADER_STDC


AC_SUBST(CXXFLAGS)

AC_OUTPUT(
    Makefile.global
)

AC_MSG_RESULT([
-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-

  Configuration summary :

    Version : ............ ${VERSION}
    Main directory : ..... ${prefix}

  Now type 'make' and 'sudo make install'
])

mercurial