~ubuntu-branches/debian/stretch/uswsusp/stretch

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Christian Perrier
  • Date: 2008-08-20 09:09:13 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080820090913-0eahue1zo8egcxls
Tags: 0.8-1.1
* Non-maintainer upload to fix pending l10n issues.
* Remove extra and useless debian/po/ff/ directory
* Debconf translation updates:
  - Japanese. Closes: #489939
  - German. Closes: #493747
  - French. Closes: #493771
  - Romanian. Closes: #493772
  - Galician. Closes: #494050
  - Finnish. Closes: #494087
  - Italian. Closes: #494096
  - Basque. Closes: #494277
  - Basque. Closes: #494277
  - Czech. Closes: #494410
  - Swedish. Closes: #494412
  - Russian. Closes: #495412
  - Portuguese. Closes: #495451
  - Spanish. Closes: #495499
  - Slovak. Closes: #495516

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# configure.ac
 
3
#
 
4
# Copyright (C) 2007 Alon Bar-Lev <alon.barlev@gmail.com>
 
5
#
 
6
# This file is released under the GPLv2.
 
7
#
 
8
 
 
9
AC_PREREQ([2.59])
 
10
AC_INIT([suspend], [0.8])
 
11
AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
 
12
AM_CONFIG_HEADER([config.h])
 
13
AC_CONFIG_SRCDIR([suspend.c])
 
14
 
 
15
AC_CANONICAL_HOST
 
16
 
 
17
AC_ARG_ENABLE(
 
18
        [debug],
 
19
        [AC_HELP_STRING([--enable-debug], [Enable debug mode])],
 
20
        ,
 
21
        [enable_debug="no"]
 
22
)
 
23
AC_ARG_ENABLE(
 
24
        [strict],
 
25
        [AC_HELP_STRING([--enable-strict], [Enable strict compile mode])],
 
26
        ,
 
27
        [enable_strict="no"]
 
28
)
 
29
AC_ARG_ENABLE(
 
30
        [pedantic],
 
31
        [AC_HELP_STRING([--enable-pedantic], [Enable pedantic compile mode])],
 
32
        ,
 
33
        [enable_pedantic="no"]
 
34
)
 
35
AC_ARG_ENABLE(
 
36
        [minimal],
 
37
        [AC_HELP_STRING([--enable-minimal], [Enable minimal build])],
 
38
        ,
 
39
        [enable_minimal="no"]
 
40
)
 
41
AC_ARG_ENABLE(
 
42
        [compress],
 
43
        [AC_HELP_STRING([--enable-compress], [Enable compress support])],
 
44
        ,
 
45
        [enable_compress="no"]
 
46
)
 
47
AC_ARG_ENABLE(
 
48
        [encrypt],
 
49
        [AC_HELP_STRING([--enable-encrypt], [Enable encryption support])],
 
50
        ,
 
51
        [enable_encrypt="no"]
 
52
)
 
53
AC_ARG_ENABLE(
 
54
        [create-device],
 
55
        [AC_HELP_STRING([--enable-create-device], [Enable create required devices, use only if you don't have udev])],
 
56
        ,
 
57
        [enable_create_device="no"]
 
58
)
 
59
AC_ARG_ENABLE(
 
60
        [resume-static],
 
61
        [AC_HELP_STRING([--disable-resume-static], [Build resume as dynamic module])],
 
62
        ,
 
63
        [enable_resume_static="yes"]
 
64
)
 
65
AC_ARG_ENABLE(
 
66
        [splashy],
 
67
        [AC_HELP_STRING([--enable-splashy], [Enable splashy support])],
 
68
        ,
 
69
        [enable_splashy="no"]
 
70
)
 
71
AC_ARG_ENABLE(
 
72
        [fbsplash],
 
73
        [AC_HELP_STRING([--enable-fbsplash], [Enable fbsplash support])],
 
74
        ,
 
75
        [enable_fbsplash="no"]
 
76
)
 
77
AC_ARG_WITH(
 
78
        [devdir],
 
79
        [AC_HELP_STRING([--with-devdir=DIR], [Use if --enable-create-device, put devices in this directory, default /dev])],
 
80
        [devdir="${withval}"],
 
81
        [devdir="/dev"]
 
82
)
 
83
AC_ARG_WITH(
 
84
        [initramfsdir],
 
85
        [AC_HELP_STRING([--with-initramfsdir=DIR], [Put initramfs binaries in this directory, default LIBDIR/suspend])],
 
86
        [initramfsdir="${withval}"],
 
87
        [initramfsdir="\$(libdir)/suspend"]
 
88
)
 
89
AC_ARG_WITH(
 
90
        [libgcrypt-prefix],
 
91
        [AC_HELP_STRING([--with-libgcrypt-prefix=DIR], [Define libgcrypt prefix, default /usr])],
 
92
        ,
 
93
        [with_libgcrypt_prefix="/usr" ]
 
94
)
 
95
AC_ARG_WITH(
 
96
        [directfb-prefix],
 
97
        [AC_HELP_STRING([--with-directfb-prefix=DIR], [Define directfb prefix, default /usr])],
 
98
        ,
 
99
        [with_directfb_prefix="/usr" ]
 
100
)
 
101
AC_ARG_WITH(
 
102
        [resume-device],
 
103
        [AC_HELP_STRING([--with-resume-device=DEVICE], [Define resume device (REQUIRED ONLY FOR BUILDING INITRAMFS DURING MAKE)])],
 
104
        [RESUME_DEVICE="${withval}"]
 
105
)
 
106
AC_ARG_WITH(
 
107
        [bootdir],
 
108
        [AC_HELP_STRING([--with-bootdir=DIR], [Define boot directory, default /boot (REQUIRED ONLY FOR BUILDING INITRAMFS DURING MAKE)])],
 
109
        [bootdir="${withval}"],
 
110
        [bootdir="/boot" ]
 
111
)
 
112
 
 
113
 
 
114
AC_PROG_CC
 
115
AC_PROG_INSTALL
 
116
AC_PROG_LIBTOOL         # We are using libtool so it auto-find static dependencies
 
117
PKG_PROG_PKG_CONFIG
 
118
AC_CHECK_PROGS([M4], [m4])
 
119
 
 
120
AC_SYS_LARGEFILE
 
121
 
 
122
if test "${enable_create_device}" = "yes"; then
 
123
        AC_CHECK_PROGS([MKNOD], [mknod])
 
124
        test -z "${MKNOD}" && AC_MSG_ERROR([mknod required for creating devices])
 
125
fi
 
126
 
 
127
case "${host}" in
 
128
        i?86-*)                 ARCH="x86";;
 
129
        x86_*-*)                ARCH="x86";;
 
130
        ppc-*|powerpc-*)        ARCH="ppc";;
 
131
        ppc64-*|powerpc64-*)    ARCH="ppc";;
 
132
esac
 
133
 
 
134
CONFIG_FEATURES=""
 
135
 
 
136
if test "${ARCH}" = "x86"; then
 
137
        AC_DEFINE([CONFIG_ARCH_X86], [1], [Define if x86 arch])
 
138
 
 
139
        PKG_CHECK_MODULES(
 
140
                [LIBPCI],
 
141
                [libpci >= 2.2.4],
 
142
                ,
 
143
                [
 
144
                        if test -z "${LIBPCI_LIBS}"; then
 
145
                                AC_CHECK_LIB(
 
146
                                        [pci],
 
147
                                        [pci_init],
 
148
                                        [LIBPCI_LIBS="-lpci"],
 
149
                                        [
 
150
                                        #force rescan
 
151
                                        unset ac_cv_lib_pci_pci_init
 
152
                                        AC_CHECK_LIB(
 
153
                                                [pci],
 
154
                                                [pci_init],
 
155
                                                [LIBPCI_LIBS="-lpci -lz"],
 
156
                                                [AC_MSG_ERROR([Required pciutils >= 2.2.4 not found])],
 
157
                                                [-lz]
 
158
                                        )]
 
159
                                )
 
160
                        fi
 
161
                ]
 
162
        )
 
163
 
 
164
        if test -z "${LIBX86_LIBS}"; then
 
165
                AC_ARG_VAR([LIBX86_CFLAGS], [C compiler flags for libx86])
 
166
                AC_ARG_VAR([LIBX86_LIBS], [linker flags for libx86])
 
167
                AC_CHECK_LIB(
 
168
                        [x86],
 
169
                        [LRMI_common_init],
 
170
                        [LIBX86_LIBS="-lx86"],
 
171
                        [AC_MSG_ERROR([Required libx86 was not found])]
 
172
                )
 
173
        fi
 
174
elif test "${ARCH}" = "ppc"; then
 
175
        AC_DEFINE([CONFIG_ARCH_PPC], [1], [Define if ppc arch])
 
176
else
 
177
        AC_MSG_ERROR([Unsupported architecture ${host}])
 
178
fi
 
179
 
 
180
if test "${enable_compress}" = "yes"; then
 
181
        CONFIG_FEATURES="${CONFIG_FEATURES} compress"
 
182
        AC_DEFINE([CONFIG_COMPRESS], [1], [Define if x86 arch])
 
183
        if test -z "${LZO_LIBS}"; then
 
184
                AC_ARG_VAR([LZO_CFLAGS], [C compiler flags for lzo])
 
185
                AC_ARG_VAR([LZO_LIBS], [linker flags for lzo])
 
186
                AC_CHECK_LIB(
 
187
                        [lzo2],
 
188
                        [lzo1x_1_compress],
 
189
                        [LZO_LIBS="-llzo2"],
 
190
                        [AC_CHECK_LIB(
 
191
                                [lzo],
 
192
                                [lzo1x_1_compress],
 
193
                                [LZO_LIBS="-llzo"],
 
194
                                [AC_MSG_ERROR([Required lzo library not found])]
 
195
                        )]
 
196
                )
 
197
        fi
 
198
fi
 
199
 
 
200
if test "${enable_encrypt}" = "yes"; then
 
201
        CONFIG_FEATURES="${CONFIG_FEATURES} encrypt"
 
202
        AC_DEFINE([CONFIG_ENCRYPT], [1], [Define if encryption enabled])
 
203
 
 
204
        AC_MSG_CHECKING([for libgcrypt])
 
205
        if ! test -x "${with_libgcrypt_prefix}/bin/libgcrypt-config"; then
 
206
                AC_MSG_ERROR([Cannot locate libgcrypt])
 
207
        else
 
208
                AC_MSG_RESULT([found])
 
209
                LIBGCRYPT_CFLAGS=`"${with_libgcrypt_prefix}/bin/libgcrypt-config" --cflags`
 
210
                LIBGCRYPT_LIBS=`"${with_libgcrypt_prefix}/bin/libgcrypt-config" --libs`
 
211
        fi
 
212
fi
 
213
 
 
214
if test "${enable_splashy}" = "yes"; then
 
215
        CONFIG_FEATURES="${CONFIG_FEATURES} splashy"
 
216
        AC_DEFINE([CONFIG_SPLASHY], [1], [Define if splashy enabled])
 
217
 
 
218
        if test -z "${SPLASHY_LIBS}"; then
 
219
                AC_ARG_VAR([SPLASHY_CFLAGS], [C compiler flags for libsplashy])
 
220
                AC_ARG_VAR([SPLASHY_LIBS], [linker flags for libsplashy])
 
221
                AC_CHECK_LIB(
 
222
                        [splashy],
 
223
                        [splashy_open],
 
224
                        [SPLASHY_LIBS="-lsplashy"],
 
225
                        [AC_MSG_ERROR([Required libsplashy was not found])]
 
226
                )
 
227
        fi
 
228
fi
 
229
 
 
230
if test "${enable_fbsplash}" = "yes"; then
 
231
        CONFIG_FEATURES="${CONFIG_FEATURES} fbsplash"
 
232
        AC_DEFINE([CONFIG_FBSPLASH], [1], [Define if fbsplash enabled])
 
233
 
 
234
        PKG_CHECK_MODULES(
 
235
                [FBSPLASH],
 
236
                [libfbsplashrender >= 0.1],
 
237
                ,
 
238
                [AC_MSG_ERROR([Required libfbsplashrender was not found])]
 
239
        )
 
240
fi
 
241
 
 
242
AC_DEFINE_UNQUOTED([CONFIG_FEATURES], ["${CONFIG_FEATURES## }"], [String representation of available features])
 
243
 
 
244
AC_HEADER_STDC
 
245
AC_CHECK_HEADERS([ \
 
246
        inttypes.h \
 
247
        stdint.h \
 
248
])
 
249
 
 
250
if test "${enable_pedantic}" = "yes"; then
 
251
        enable_strict="yes";
 
252
        CFLAGS="${CFLAGS} -pedantic"
 
253
fi
 
254
if test "${enable_strict}" = "yes"; then
 
255
        CFLAGS="${CFLAGS} -Wall -Wextra"
 
256
fi
 
257
 
 
258
# workaround for old autoconf
 
259
if test -z "${docdir}"; then
 
260
        docdir="\$(datarootdir)/doc/\$(PACKAGE_NAME)"
 
261
        AC_SUBST([docdir])
 
262
fi
 
263
# end workaround
 
264
 
 
265
AC_SUBST([devdir])
 
266
AC_SUBST([initramfsdir])
 
267
AC_SUBST([bootdir])
 
268
AC_SUBST([LIBGCRYPT_CFLAGS])
 
269
AC_SUBST([LIBGCRYPT_LIBS])
 
270
AC_SUBST([RESUME_DEVICE])
 
271
AM_CONDITIONAL([ENABLE_DEBUG], [test "${enable_debug}" = "yes"])
 
272
AM_CONDITIONAL([ENABLE_MINIMAL], [test "${enable_minimal}" = "yes"])
 
273
AM_CONDITIONAL([ARCH_X86], [test "${ARCH}" = "x86"])
 
274
AM_CONDITIONAL([ARCH_PPC], [test "${ARCH}" = "ppc"])
 
275
AM_CONDITIONAL([ENABLE_ENCRYPT], [test "${enable_encrypt}" = "yes"])
 
276
AM_CONDITIONAL([ENABLE_RESUME_STATIC], [test "${enable_resume_static}" = "yes"])
 
277
AM_CONDITIONAL([ENABLE_CREATE_DEVICE], [test "${enable_create_device}" = "yes"])
 
278
AM_CONDITIONAL([ENABLE_SPLASHY], [test "${enable_splashy}" = "yes"])
 
279
AM_CONDITIONAL([ENABLE_FBSPLASH], [test "${enable_fbsplash}" = "yes"])
 
280
AC_CONFIG_FILES([
 
281
        Makefile
 
282
        doc/Makefile
 
283
        scripts/Makefile
 
284
        scripts/suse-10.1/Makefile
 
285
])
 
286
AC_OUTPUT
 
287