Tomas Cejka | 96f4e61 | 2012-12-10 00:03:32 +0100 | [diff] [blame] | 1 | # -*- Autoconf -*- |
| 2 | # Process this file with autoconf to produce a configure script. |
| 3 | |
| 4 | AC_PREREQ([2.63]) |
| 5 | AC_INIT([mod_netconf], [1.0]) |
| 6 | AC_CONFIG_SRCDIR([mod_netconf.c]) |
| 7 | |
| 8 | # Checks for programs. |
| 9 | #AC_PROG_CC |
| 10 | AC_PROG_INSTALL |
| 11 | |
| 12 | # Check for rpmbuil |
| 13 | AC_CHECK_PROG(RPMBUILD, rpmbuild, rpmbuild) |
| 14 | |
| 15 | RELEASE=1 |
| 16 | AC_SUBST(RELEASE) |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 17 | LIBS="-lnetconf -ljson" |
Tomas Cejka | 96f4e61 | 2012-12-10 00:03:32 +0100 | [diff] [blame] | 18 | |
Tomas Cejka | 689a104 | 2013-01-16 15:08:25 +0100 | [diff] [blame] | 19 | if test "`git show > /dev/null 2>&1;echo $?`" = "0"; then |
| 20 | RCSID="-DRCSID=\\\"\$(IDGIT)\\\"" |
| 21 | ARCSID="-DARCSID='\\\"\$(IDGIT)\\\"'" |
| 22 | else |
| 23 | RCSID="-DRCSID=\\\"\$(IDNOGIT)\\\"" |
| 24 | ARCSID="-DARCSID='\\\"\$(IDNOGIT)\\\"'" |
| 25 | fi |
| 26 | |
Tomas Cejka | 96f4e61 | 2012-12-10 00:03:32 +0100 | [diff] [blame] | 27 | REQS="$REQS httpd php json-c" |
| 28 | BUILDREQS="$BUILDREQS json-c-devel httpd-devel" |
| 29 | |
| 30 | # Checks for libraries. |
| 31 | AC_SEARCH_LIBS([ncds_apply_rpc],[netconf], ,AC_MSG_ERROR([libnetconf not found!])) |
Tomas Cejka | ba21b38 | 2013-04-13 02:37:32 +0200 | [diff] [blame] | 32 | REQS="$REQS libnetconf >= 0.4.0 libwebsockets" |
| 33 | BUILDREQS="$BUILDREQS libnetconf-devel libwebsockets-devel" |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 34 | CPPFLAGS="" |
Tomas Cejka | 96f4e61 | 2012-12-10 00:03:32 +0100 | [diff] [blame] | 35 | |
| 36 | # Checks for header files. |
| 37 | AC_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 | |
| 43 | AC_SUBST(RPMBUILD) |
| 44 | if test -z "$RPMBUILD"; then |
| 45 | AC_MSG_WARN([Due to missing rpmbuild you will not able to generate RPM package.]) |
| 46 | fi |
| 47 | |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 48 | |
| 49 | AC_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 Cejka | 96f4e61 | 2012-12-10 00:03:32 +0100 | [diff] [blame] | 58 | AC_SUBST(REQS) |
| 59 | AC_SUBST(BUILDREQS) |
Tomas Cejka | 689a104 | 2013-01-16 15:08:25 +0100 | [diff] [blame] | 60 | AC_SUBST(CPPFLAGS) |
| 61 | AC_SUBST(RCSID) |
| 62 | AC_SUBST(ARCSID) |
Tomas Cejka | d340dbf | 2013-03-24 20:36:57 +0100 | [diff] [blame] | 63 | AC_SUBST(LIBS) |
Tomas Cejka | 96f4e61 | 2012-12-10 00:03:32 +0100 | [diff] [blame] | 64 | |
| 65 | AC_CONFIG_FILES([Makefile]) |
| 66 | AC_CONFIG_FILES([mod_netconf.spec]) |
| 67 | AC_OUTPUT |