blob: 26715ae904bbb473d9bfe25f7e39685a08f54956 [file] [log] [blame]
Tomas Cejka96f4e612012-12-10 00:03:32 +01001# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.63])
5AC_INIT([mod_netconf], [1.0])
6AC_CONFIG_SRCDIR([mod_netconf.c])
7
8# Checks for programs.
9#AC_PROG_CC
10AC_PROG_INSTALL
11
12# Check for rpmbuil
13AC_CHECK_PROG(RPMBUILD, rpmbuild, rpmbuild)
14
15RELEASE=1
16AC_SUBST(RELEASE)
Tomas Cejkad340dbf2013-03-24 20:36:57 +010017LIBS="-lnetconf -ljson"
Tomas Cejka96f4e612012-12-10 00:03:32 +010018
Tomas Cejka689a1042013-01-16 15:08:25 +010019if test "`git show > /dev/null 2>&1;echo $?`" = "0"; then
20 RCSID="-DRCSID=\\\"\$(IDGIT)\\\""
21 ARCSID="-DARCSID='\\\"\$(IDGIT)\\\"'"
22else
23 RCSID="-DRCSID=\\\"\$(IDNOGIT)\\\""
24 ARCSID="-DARCSID='\\\"\$(IDNOGIT)\\\"'"
25fi
26
Tomas Cejka96f4e612012-12-10 00:03:32 +010027REQS="$REQS httpd php json-c"
28BUILDREQS="$BUILDREQS json-c-devel httpd-devel"
29
30# Checks for libraries.
31AC_SEARCH_LIBS([ncds_apply_rpc],[netconf], ,AC_MSG_ERROR([libnetconf not found!]))
Tomas Cejkaba21b382013-04-13 02:37:32 +020032REQS="$REQS libnetconf >= 0.4.0 libwebsockets"
33BUILDREQS="$BUILDREQS libnetconf-devel libwebsockets-devel"
Tomas Cejkad340dbf2013-03-24 20:36:57 +010034CPPFLAGS=""
Tomas Cejka96f4e612012-12-10 00:03:32 +010035
36# Checks for header files.
37AC_CHECK_HEADER([libnetconf.h], ,AC_MSG_ERROR([libnetconf.h not found!]))
38
39# Checks for typedefs, structures, and compiler characteristics.
40
41# Checks for library functions.
42
43AC_SUBST(RPMBUILD)
44if test -z "$RPMBUILD"; then
45 AC_MSG_WARN([Due to missing rpmbuild you will not able to generate RPM package.])
46fi
47
Tomas Cejkad340dbf2013-03-24 20:36:57 +010048
49AC_ARG_WITH([notifications],
50 [AC_HELP_STRING([--with-notifications], [Enable notifications])],
51 [
52 CPPFLAGS=" -DWITH_NOTIFICATIONS "
53 LIBS="-lwebsockets $LIBS"
54 ],
55 [CPPFLAGS="$CPPFLAGS"]
56)
57
Tomas Cejka96f4e612012-12-10 00:03:32 +010058AC_SUBST(REQS)
59AC_SUBST(BUILDREQS)
Tomas Cejka689a1042013-01-16 15:08:25 +010060AC_SUBST(CPPFLAGS)
61AC_SUBST(RCSID)
62AC_SUBST(ARCSID)
Tomas Cejkad340dbf2013-03-24 20:36:57 +010063AC_SUBST(LIBS)
Tomas Cejka96f4e612012-12-10 00:03:32 +010064
65AC_CONFIG_FILES([Makefile])
66AC_CONFIG_FILES([mod_netconf.spec])
67AC_OUTPUT