-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfigure.ac
55 lines (43 loc) · 1.46 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
52
53
54
55
# the autoconf initilization.
AC_INIT(mpq-tools, 0.4.2, [[email protected]], [mpq-tools])
# detect the canonical host and target build environment.
AC_CANONICAL_SYSTEM
# initialize autoconf and automake system.
AM_INIT_AUTOMAKE([no-dependencies])
AC_CONFIG_HEADERS([config.h:config.h.in])
# create define for the package author.
AC_DEFINE([AUTHOR], ["Maik Broemme <[email protected]>"], [Define to the author of this package.])
# notices.
AC_PREREQ(2.53)
AC_REVISION($Revision: 1.6 $)
# checking for programs.
AC_PROG_CC
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
# checking for pkg-config.
AC_CHECK_PROG([have_pkg_config], [pkg-config], [yes])
# checking if we have pkg-config or not.
if test "$have_pkg_config" = "yes"; then
# checking for libmpq.
PKG_CHECK_MODULES([LIBMPQ], [libmpq >= 0.4.2], [HAVE_LIBMPQ="yes"], [AC_MSG_ERROR([*** $LIBMPQ_PKG_ERRORS])])
fi
if test -z "$have_pkg_config"; then
# checking for mpq library.
AC_CHECK_HEADER([libmpq/mpq.h], [], [AC_MSG_ERROR([*** mpq.h is required, install libmpq header files])])
AC_PATH_PROG([libmpq_config], [libmpq-config], [AC_MSG_ERROR([*** libmpq-config is required, install libmpq development files])])
# checking for libmpq environment.
if test -n "$libmpq_config"; then
LIBMPQ_CFLAGS="$(libmpq-config --cflags)"
LIBMPQ_LIBS="$(libmpq-config --libs)"
fi
fi
# export library flags.
AC_SUBST(LIBMPQ_CFLAGS)
AC_SUBST(LIBMPQ_LIBS)
# creating files.
AC_OUTPUT([
Makefile
src/Makefile
doc/Makefile
doc/man1/Makefile
])