File: configure.in

package info (click to toggle)
pbbuttonsd 0.7.9-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,416 kB
  • ctags: 2,350
  • sloc: ansic: 17,517; sh: 4,626; makefile: 552; yacc: 288; cpp: 203; sed: 16
file content (202 lines) | stat: -rw-r--r-- 5,476 bytes parent folder | download | duplicates (2)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
dnl Process this file with autoconf to produce a configure script.

AC_INIT(configure.in)
AM_INIT_AUTOMAKE(pbbuttonsd, 0.7.9)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

dnl Checks for programs.
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_STDC
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

AC_SUBST(localstatedir, "/var/lib")

echo -n "checking for system: "
ac_laptop=powerbook
if test "x$laptop" != "x"; then
    ac_laptop=$laptop
elif test "x$LAPTOP" != "x"; then
    ac_laptop=$LAPTOP
fi
case "$ac_laptop" in
    POWERBOOK | powerbook | pb | PB )
	AC_DEFINE_UNQUOTED(SYS_POWERBOOK, "", [machine to build the package for])
	ac_laptop="Apple PowerBook"
	;;
    I386ACPI | i386acpi | acpi | ACPI )
	AC_DEFINE_UNQUOTED(SYS_I386_ACPI, "", [machine to build the package for])
	ac_laptop="Intel based laptop with ACPI"
	;;
    I386 | i386)
	AC_DEFINE_UNQUOTED(SYS_I386_GENERIC, "", [machine to build the package for])
	ac_laptop="Intel based laptop"
	;;
    *)
        echo -e "\nOption 'laptop' not set or unknown. Please call 'configure laptop=<target>'"
        echo "Possible targets are: powerbook"
        AC_MSG_ERROR(unknown target system)
	;;
esac
echo "$ac_laptop"

dnl Checks for libraries.
AC_CHECK_LIB([dl], [dlopen])

pkg_modules="glib-2.0 >= 2.0.0"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)

PB_OBJECTS=
PB_LIBS=

pbb_with_pmud=no
AC_ARG_WITH(pmud, [  --with-pmud             use pmud as low level power manager (default=no)],
	pbb_with_pmud=$withval, )
if test "$pbb_with_pmud" == "yes"; then
	AC_DEFINE_UNQUOTED(WITH_PMUD, 1, [use pmud as basement])
	PB_OBJECTS+="tcp.$OBJEXT"
fi

pbb_with_oss=yes
AC_ARG_WITH(oss,  [  --with-oss              enable OSS support in pbbuttonsd (default=yes)],
	pbb_with_oss=$withval, )
if test "$pbb_with_oss" == "yes"; then
	AC_DEFINE_UNQUOTED(WITH_OSS, 1, [enable OSS support])
fi

pbb_with_alsa=yes
AC_ARG_WITH(alsa, [  --with-alsa             enable ALSA support in pbbuttonsd (default=yes)],
	pbb_with_alsa=$withval, )
if test "$pbb_with_alsa" == "yes"; then
	AM_PATH_ALSA(1.0.0, [pbb_have_alsa=yes], [pbb_have_alsa=no]) 
	if test "$pbb_have_alsa" == "yes"; then
		AC_DEFINE_UNQUOTED(WITH_ALSA, 1, [enable ALSA support])
	fi
fi

pbb_with_ibam=yes
AC_ARG_WITH(ibam, [  --with-ibam             enable IBAM support in pbbuttonsd (default=yes)],
	pbb_with_ibam=$withval, )
if test "$pbb_with_ibam" == "yes"; then
	AC_DEFINE_UNQUOTED(WITH_IBAM, 1, [enable IBAM support])
	PB_OBJECTS+=" ibam_stub.$OBJEXT"
	PB_LIBS+=" -lstdc++"
fi

AM_CONDITIONAL(DEBUG, test "$enable_debug" = yes)
if test "$enable_debug" == "yes"; then
	PB_OBJECTS+=" module_peep.$OBJEXT"
fi

AC_SUBST([PB_OBJECTS])
AC_SUBST([PB_LIBS])

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([initreq.h alloca.h argz.h errno.h fcntl.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h unistd.h])

dnl defining some constants
dnl Add the languages which your application supports here.
ALL_LINGUAS="de ca es"
AM_GNU_GETTEXT

dnl hell, is that really what we have to do, when we want to support
dnl gettext versions before autopoint was introduced to gettext (0.11.3)?
dnl bastard autopoint script checks for "^AM_GNU_GETTEXT_VERSION(x.y.z)"
ifdef(AM_GNU_GETTEXT_VERSION,
AM_GNU_GETTEXT_VERSION(0.13.1)
, )

dnl Set SYS_CONF_DIR in config.h.
if test "x${sysconfdir}" = 'x${prefix}/etc'; then
  if test "x${prefix}" = "xNONE"; then
    pbb_sysconfdir="${ac_default_prefix}/etc"
  else
    pbb_sysconfdir="${prefix}/etc"
  fi
else
  pbb_sysconfdir=${sysconfdir}
fi
AC_DEFINE_UNQUOTED(SYS_CONF_DIR, "${pbb_sysconfdir}", [place for configuration files])

dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
  if test "x${prefix}" = "xNONE"; then
    pbb_datadir="${ac_default_prefix}/share"
  else
    pbb_datadir="${prefix}/share"
  fi
else
  pbb_datadir=${datadir}
fi
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${pbb_datadir}", [place for data files])

pbb_localedir="${pbb_datadir}/locale"
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${pbb_localedir}", [target dir for package])

AC_OUTPUT([
Makefile
src/Makefile
po/Makefile.in
po/Makefile
libpbbipc/Makefile
pbbcmd/Makefile
intl/Makefile
])

echo -e "------------------------------------------------------"
echo -e "PBButtonsd configuration summary\n"
echo -e "System: $ac_laptop\n"
echo -e "Options:"
echo -n "   pmud support "
if test "$pbb_with_pmud" == "yes"; then
	echo "enabled"
else
	echo "disabled"
fi
echo -n "   OSS  support "
if test "$pbb_with_oss" == "yes"; then
	echo "enabled"
else
	echo "disabled"
fi
echo -n "   ALSA support "
if test "$pbb_have_alsa" == "yes"; then
	echo "enabled"
elif test "$pbb_with_alsa" == "yes"; then
	echo "not available (development files?)"
else
	echo "disabled"
fi
echo -n "   IBAM support "
if test "$pbb_with_ibam" == "yes"; then
	echo "enabled"
else
	echo "disabled"
fi	
echo -n "   Debug mode "
if test "$enable_debug" == "yes"; then
	echo "enabled"
else
	echo "disabled"
fi

echo -e "\nPaths:"
echo -e "   config:   $pbb_sysconfdir"
echo -e "   data:     $pbb_datadir"
echo -e "   locale:   $pbb_localedir"
echo -e "   batlog:   /var/lib/pbbuttons            (hardcoded)"
echo -e "   ibam:     /var/lib/ibam                 (hardcoded)" 
echo -e "\nCompiler:"
echo -e "   CFLAGS:   $CFLAGS"
echo -e "   CXXFLAGS: $CXXFLAGS"
echo -e "------------------------------------------------------"