xref: /freebsd/contrib/pkgconf/configure.ac (revision a3cefe7f2b4df0f70ff92d4570ce18e517af43ec)
1dnl configure.ac
2dnl m4 preprocessor script for autotools
3dnl
4dnl Copyright (c) 2011, 2012, 2013, 2014 pkgconf authors (see AUTHORS).
5dnl
6dnl Permission to use, copy, modify, and/or distribute this software for any
7dnl purpose with or without fee is hereby granted, provided that the above
8dnl copyright notice and this permission notice appear in all copies.
9dnl
10dnl This software is provided 'as is' and without any warranty, express or
11dnl implied.  In no event shall the authors be liable for any damages arising
12dnl from the use of this software.
13
14AC_PREREQ([2.71])
15AC_INIT([pkgconf],[2.5.1],[https://github.com/pkgconf/pkgconf/issues/new])
16AC_CONFIG_SRCDIR([cli/main.c])
17AC_CONFIG_MACRO_DIR([m4])
18AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
19AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
20AX_CHECK_COMPILE_FLAG([-Wformat=2], [CFLAGS="$CFLAGS -Wformat=2"])
21AX_CHECK_COMPILE_FLAG([-std=gnu99], [CFLAGS="$CFLAGS -std=gnu99"], [
22	AX_CHECK_COMPILE_FLAG([-std=c99], [CFLAGS="$CFLAGS -std=c99"])
23])
24AC_CONFIG_HEADERS([libpkgconf/config.h])
25AC_CHECK_DECLS([strlcpy, strlcat, strndup], [], [], [[#include <string.h>]])
26AC_CHECK_DECLS([pledge, unveil], [], [], [[#include <unistd.h>]])
27AC_CHECK_DECLS([reallocarray])
28AC_CHECK_HEADERS([sys/stat.h])
29AM_INIT_AUTOMAKE([foreign dist-xz subdir-objects])
30AM_SILENT_RULES([yes])
31LT_INIT
32
33AC_SYS_LARGEFILE
34
35AC_ARG_WITH([personality-dir],[AS_HELP_STRING([--with-personality-dir],[specify
36	     the place where cross-compile personality files will be found])],
37	     PERSONALITY_PATH="$withval",
38	     PERSONALITY_PATH="${datadir}/pkgconfig/personality.d:${sysconfdir}/pkgconfig/personality.d")
39
40AC_SUBST([PERSONALITY_PATH])
41
42AC_ARG_WITH([pkg-config-dir],[AS_HELP_STRING([--with-pkg-config-dir],[specify
43	     the place where pc files will be found])],PKG_DEFAULT_PATH="$withval",
44	     PKG_DEFAULT_PATH="${libdir}/pkgconfig:${datadir}/pkgconfig")
45
46AC_SUBST([PKG_DEFAULT_PATH])
47
48AC_ARG_WITH([system-libdir],[AS_HELP_STRING([--with-system-libdir],[specify the
49	     system library directory (default LIBDIR)])],
50	     SYSTEM_LIBDIR="$withval", SYSTEM_LIBDIR="${libdir}")
51
52AC_SUBST([SYSTEM_LIBDIR])
53
54AC_ARG_WITH([system-includedir],[AS_HELP_STRING([--with-system-includedir],[specify the
55	     system include directory (default INCLUDEDIR)])],
56	     SYSTEM_INCLUDEDIR="$withval", SYSTEM_INCLUDEDIR="${includedir}")
57
58AC_SUBST([SYSTEM_INCLUDEDIR])
59
60AC_PROG_CPP
61AC_PROG_CC
62AC_PROG_INSTALL
63AC_PROG_LN_S
64
65AC_CONFIG_FILES([Makefile Kyuafile libpkgconf.pc tests/Kyuafile tests/test_env.sh])
66AC_OUTPUT
67