-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
51 lines (40 loc) · 1.66 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([stabber], [0.1.0], [[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign subdir-objects])
LT_INIT
### Checks for programs.
AC_PROG_CC
### Get canonical host
AC_CANONICAL_HOST
PLATFORM="unknown"
AS_CASE([$host_os],
[freebsd*], [PLATFORM="freebsd" AC_DEFINE([PLATFORM_FREEBSD], [1], [FreeBSD])],
[darwin*], [PLATFORM="osx" AC_DEFINE([PLATFORM_OSX], [1], [OSx])],
[cygwin], [PLATFORM="cygwin" AC_DEFINE([PLATFORM_CYGWIN], [1], [Cygwin])],
[PLATFORM="nix" AC_DEFINE([PLATFORM_NIX], [1], [Nix])])
PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.26], [],
[AC_MSG_ERROR([glib 2.26 or higher is required])])
PKG_CHECK_MODULES([expat], [expat >= 2.0.0], [],
[AC_CHECK_HEADER([expat.h],
[expat_LIBS="-lexpat"],
[AC_MSG_ERROR([expat 2.0.0 or higher is required])])])
PKG_CHECK_MODULES([libmicrohttpd], [libmicrohttpd >= 0.9.71],
[AC_CHECK_HEADER([microhttpd.h],
[microhttpd_LIBS="-lmicrohttpd"],
[AC_MSG_ERROR([libmicrohttpd 0.9.71 or higher is required])])], [])
AC_CHECK_LIB([pthread], [main], [],
[AC_MSG_ERROR([pthread is required])])
AM_CFLAGS="-Wall -Wno-deprecated-declarations"
AM_CFLAGS="$AM_CFLAGS -Wunused -Werror"
AM_CPPFLAGS="$AM_CPPFLAGS $glib_CFLAGS $expat_CFLAGS $microhttpd_CFLAGS"
LIBS="$glib_LIBS $expat_LIBS $microhttpd_LIBS $LIBS"
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_CPPFLAGS)
### Checks for library functions.
AC_CHECK_FUNCS([atexit memset strdup strstr])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT