configure.ac

Sat, 16 May 2015 17:39:30 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 16 May 2015 17:39:30 +0200
changeset 362
c92651a54969
parent 353
7993cb2d4b92
child 363
468ec0d96cce
permissions
-rw-r--r--

Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0

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

AC_INIT(thermometers/thermometers.c)
AM_CONFIG_HEADER(config.h)
SUBDIRS="dht11 rc433 thermferm thermometers"
AC_SUBST(SUBDIRS)

dnl General settings
dnl After changeing the version number, run autoconf!
PACKAGE="mbsePi-apps"
VERSION="0.3.0"
COPYRIGHT="Copyright (C) 2014-2015 Michiel Broek, All Rights Reserved"
CYEARS="2014-2015"
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)
AC_CHECK_PROG(TAR, tar, tar)

#
# Libraries for mbsePi-apps
#
WIRINGPI=No
AC_CHECK_LIB(wiringPi,wiringPiSetup,result=yes,result=no)
if test "$result" = "yes"; then
  LIBS="$LIBS -lwiringPi -lwiringPiDev"
  AC_CHECK_HEADERS(wiringPi.h,WIRINGPI=Yes,WIRINGPI=No)
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

SIMULATOR=No
AC_ARG_ENABLE(simulator,  [  --enable-simulator      Compile simulator code], [ simulator=$enableval ], [ simulator=no ])
if test "$simulator" = "yes"; then
  AC_DEFINE(USE_SIMULATOR)
  SIMULATOR=Yes
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
LIBS="$LIBS -lm"


AC_CHECK_LIB(xml2,xmlParseFile,result=yes,result=no)
if test "$result" = "yes"; then
  LIBS="$LIBS -lxml2"
  CFLAGS="$CFLAGS $(xml2-config --cflags)"
  AC_CHECK_HEADERS(libxml/xmlmemory.h)
else
  AC_MSG_ERROR(libxml2 not found)
fi

AC_CHECK_LIB(uuid,uuid_generate,result=yes,result=no)
if test "$result" = "yes"; then
  LIBS="$LIBS $(pkg-config --libs uuid)"
  CFLAGS="$CFLAGS $(pkg-config --cflags uuid)"
  AC_CHECK_HEADERS(uuid/uuid.h)
else
  AC_MSG_ERROR(libuuid not found)
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}
    WiringPi : ........... ${WIRINGPI}
    Simulator : .......... ${SIMULATOR}

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

mercurial