configure.ac

Sun, 23 May 2021 16:41:35 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 23 May 2021 16:41:35 +0200
changeset 752
f68e3bbc1ada
parent 732
db4de4f37b65
child 766
86289b0c4a27
permissions
-rw-r--r--

Fermentables, hops, miscs and yeast now have tests against the added moment with the brewing stage. Added to inventory edit rows, delete rows, and pick choices for the moment to add or edit. Some more popups to explain certain blocks.

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

AC_INIT(bmsd/bms.c)
AM_CONFIG_HEADER(config.h)
SUBDIRS="bmsd doc script tools www"
AC_SUBST(SUBDIRS)

dnl General settings
dnl After changeing the version number, run autoconf!
PACKAGE="bms"
VERSION="0.3.37"
COPYRIGHT="Copyright (C) 2016-2021 Michiel Broek, All Rights Reserved"
CYEARS="2016-2021"
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(COPYRIGHT)
AC_SUBST(CYEARS)
AC_PREFIX_DEFAULT(/var/lib/bms)
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)


#
# Additional commandline switches
#

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"


#
# Libraries for bms
#
AC_CHECK_LIB(mosquitto,mosquitto_lib_init,result=yes,result=no)
if test "$result" = "yes"; then
  LIBS="$LIBS -lmosquitto"
  AC_CHECK_HEADERS(mosquitto.h)
else
  AC_MSG_ERROR(mosquitto not found)
fi

AC_CHECK_LIB(json-c,json_object_iter_init_default,result=yes,result=no)
if test "$result" = "yes"; then
  LIBS="$LIBS -ljson-c"
  AC_CHECK_HEADERS(json-c/json.h)
else
  AC_MSG_ERROR(json-c not found)
fi

AC_CHECK_LIB(mysqlclient,mysql_server_init,result=yes,result=no)
if test "$result" = "yes"; then
  LIBS="$LIBS -lmysqlclient"
  AC_CHECK_HEADERS(mysql/mysql.h)
  AC_CHECK_HEADERS(mariadb/mysql.h)
else
  AC_MSG_ERROR(mysqlclient not found)
fi

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

AC_CHECK_LIB(websockets,lws_client_connect,result=yes,result=no)
if test "$result" = "yes"; then
  LIBS="$LIBS -lwebsockets"
  AC_CHECK_HEADERS(libwebsockets.h)
else
  AC_MSG_ERROR(libwebsockets not found)
fi



dnl Checks for header files.
AC_HEADER_STDC

AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)


AC_OUTPUT(
    Makefile.global
    www/version.php
)

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

  Configuration summary :

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


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

mercurial