Debian Codegraph @

configure.in

raw
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(src/elements.c)
3
4 dnl
5 dnl Set versions
6 dnl
7 PMIDI_MAJOR_VERSION=1
8 PMIDI_MINOR_VERSION=7
9 PMIDI_MICRO_VERSION=1
10 PMIDI_INTERFACE_AGE=0
11 PMIDI_BINARY_AGE=0
12 PMIDI_VERSION=$PMIDI_MAJOR_VERSION.$PMIDI_MINOR_VERSION.$PMIDI_MICRO_VERSION
13
14 AC_SUBST(PMIDI_MAJOR_VERSION)
15 AC_SUBST(PMIDI_MINOR_VERSION)
16 AC_SUBST(PMIDI_MICRO_VERSION)
17 AC_SUBST(PMIDI_INTERFACE_AGE)
18 AC_SUBST(PMIDI_BINARY_AGE)
19 AC_SUBST(PMIDI_VERSION)
20
21 dnl
22 dnl Detect the canonical host and target build environment
23 dnl
24 AC_CANONICAL_HOST
25 AC_CANONICAL_TARGET
26
27 dnl
28 dnl Setup for automake
29 dnl
30 AM_INIT_AUTOMAKE(pmidi, $PMIDI_VERSION)
31
32 dnl
33 dnl Checks for programs.
34 dnl
35 AC_PROG_CC
36 AC_PROG_INSTALL
37
38 dnl
39 dnl Checks for libraries.
40 dnl
41
42 dnl
43 dnl Initial values for exported symbols.
44 dnl
45 WITH_ALSA=1
46 WITH_INCLUDED_GLIB=1
47
48 AC_SUBST(WITH_ALSA)
49 AM_PATH_ALSA
50
51 dnl AC_CHECK_LIB(m,main)
52 dnl AC_CHECK_LIB(asound, snd_seq_open, [LIBS="$LIBS -lasound"])
53 AC_CHECK_LIB(asound, snd_seq_drain_output,AC_DEFINE(USE_DRAIN,1),,$ALSA_LIBS)
54
55 dnl
56 dnl Check for parameters to configure
57 dnl
58 AC_ARG_WITH(included_glib,
59 [ --with-included-glib build with included GLIB [default=auto]],
60 [included_glib="$withval"],
61 [included_glib=auto])
62
63
64 dnl
65 dnl Check the system header files for glib.h
66 dnl and set the parameters accordingly.
67 dnl
68 if test "$included_glib" = "auto" || test "$included_glib" = "no"; then
69 AC_PATH_PROGS(GLIBCNF, glib-config)
70 if test x"$GLIBCNF" != x""; then
71 CFLAGS="$CFLAGS `$GLIBCNF --cflags`"
72 CPPFLAGS="$CFLAGS `$GLIBCNF --cflags`"
73 LIBS="$LIBS `$GLIBCNF --libs`"
74 WITH_INCLUDED_GLIB=0
75 AC_SUBST(GLIBCNF)
76 fi
77 fi
78
79 AC_CHECK_HEADER(glib.h, WITH_INCLUDED_GLIB=0, WITH_INCLUDED_GLIB=1)
80
81 dnl
82 dnl If using the system's GLIB library, setup
83 dnl will exclude the included GLIB
84 dnl
85 AM_CONDITIONAL(GLIB, test x$WITH_INCLUDED_GLIB = x1)
86 AC_SUBST(WITH_INCLUDED_GLIB)
87
88 dnl
89 dnl Checks for header files.
90 dnl
91 AC_HEADER_STDC
92 AC_CHECK_HEADERS(unistd.h alsa/asoundlib.h)
93
94 dnl
95 dnl Checks for typedefs, structures, and compiler characteristics.
96 dnl
97 AC_C_CONST
98
99 dnl
100 dnl Checks for library functions.
101 dnl
102 AC_FUNC_VPRINTF
103
104 AC_OUTPUT([ \
105 man/Makefile \
106 src/Makefile \
107 Makefile \
108 pmidi.spec \
109 ])
110