Line 0
Link Here
|
|
|
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.60]) |
10 |
AC_INIT([suspend], [0.6_beta1]) |
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 |
[minimal], |
25 |
[AC_HELP_STRING([--enable-minimal], [Enable minimal build])], |
26 |
, |
27 |
[enable_minimal="no"] |
28 |
) |
29 |
AC_ARG_ENABLE( |
30 |
[compress], |
31 |
[AC_HELP_STRING([--enable-compress], [Enable compress support])], |
32 |
, |
33 |
[enable_compress="no"] |
34 |
) |
35 |
AC_ARG_ENABLE( |
36 |
[encrypt], |
37 |
[AC_HELP_STRING([--enable-encrypt], [Enable encryption support])], |
38 |
, |
39 |
[enable_encrypt="no"] |
40 |
) |
41 |
AC_ARG_ENABLE( |
42 |
[create-device], |
43 |
[AC_HELP_STRING([--enable-create-device], [Enable create required devices, use only if you don't have udev])], |
44 |
, |
45 |
[enable_create_device="no"] |
46 |
) |
47 |
AC_ARG_ENABLE( |
48 |
[resume-static], |
49 |
[AC_HELP_STRING([--disable-resume-static], [Build resume as dynamic module])], |
50 |
, |
51 |
[enable_resume_static="yes"] |
52 |
) |
53 |
AC_ARG_ENABLE( |
54 |
[splashy], |
55 |
[AC_HELP_STRING([--enable-splashy], [Enable splashy support])], |
56 |
, |
57 |
[enable_splashy="no"] |
58 |
) |
59 |
AC_ARG_WITH( |
60 |
[devdir], |
61 |
[AC_HELP_STRING([--with-devdir=DIR], [Use if --enable-create-device, put devices in this directory, default /dev])], |
62 |
[devdir="${withval}"], |
63 |
[devdir="/dev"] |
64 |
) |
65 |
AC_ARG_WITH( |
66 |
[initramfsdir], |
67 |
[AC_HELP_STRING([--with-initramfsdir=DIR], [Put initramfs binaries in this directory, default LIBDIR/suspend])], |
68 |
[initramfsdir="${withval}"], |
69 |
[initramfsdir="\$(libdir)/suspend"] |
70 |
) |
71 |
AC_ARG_WITH( |
72 |
[libgcrypt-prefix], |
73 |
[AC_HELP_STRING([--with-libgcrypt-prefix=DIR], [Define libgcrypt prefix, default /usr])], |
74 |
, |
75 |
[with_libgcrypt_prefix="/usr" ] |
76 |
) |
77 |
AC_ARG_WITH( |
78 |
[directfb-prefix], |
79 |
[AC_HELP_STRING([--with-directfb-prefix=DIR], [Define directfb prefix, default /usr])], |
80 |
, |
81 |
[with_directfb_prefix="/usr" ] |
82 |
) |
83 |
AC_ARG_WITH( |
84 |
[resume-device], |
85 |
[AC_HELP_STRING([--with-resume-device=DEVICE], [Define resume device (REQUIRED ONLY FOR BUILDING INITRAMFS DURING MAKE)])], |
86 |
[RESUME_DEVICE="${withval}"] |
87 |
) |
88 |
AC_ARG_WITH( |
89 |
[boot-dir], |
90 |
[AC_HELP_STRING([--with-bootdir=DIR], [Define boot directory, default /boot (REQUIRED ONLY FOR BUILDING INITRAMFS DURING MAKE)])], |
91 |
[bootdir="${withval}"], |
92 |
[bootdir="/boot" ] |
93 |
) |
94 |
|
95 |
|
96 |
AC_PROG_CC |
97 |
AC_PROG_INSTALL |
98 |
AC_PROG_LIBTOOL # We are using libtool so it auto-find static dependencies |
99 |
PKG_PROG_PKG_CONFIG |
100 |
AC_CHECK_PROGS([M4], [m4]) |
101 |
if test "${enable_create_device}" = "yes"; then |
102 |
AC_CHECK_PROGS([MKNOD], [mknod]) |
103 |
test -z "${MKNOD}" && AC_MSG_ERROR([mknod required for creating devices]) |
104 |
fi |
105 |
|
106 |
case "${host}" in |
107 |
i?86-*) ARCH="x86";; |
108 |
x86_*-*) ARCH="x86";; |
109 |
ppc-*) ARCH="ppc";; |
110 |
esac |
111 |
|
112 |
if test "${ARCH}" = "x86"; then |
113 |
AC_DEFINE([CONFIG_ARCH_X86], [1], [Define if x86 arch]) |
114 |
|
115 |
PKG_CHECK_MODULES( |
116 |
[LIBPCI], |
117 |
[libpci >= 2.2.4], |
118 |
, |
119 |
[ |
120 |
if test -z "${LIBPCI_LIBS}"; then |
121 |
AC_CHECK_LIB( |
122 |
[pci], |
123 |
[pci_init], |
124 |
[LIBPCI_LIBS="-lpci"], |
125 |
[ |
126 |
#force rescan |
127 |
unset ac_cv_lib_pci_pci_init |
128 |
AC_CHECK_LIB( |
129 |
[pci], |
130 |
[pci_init], |
131 |
[LIBPCI_LIBS="-lpci -lz"], |
132 |
[AC_MSG_ERROR([Required pciutils >= 2.2.4 not found])], |
133 |
[-lz] |
134 |
)] |
135 |
) |
136 |
fi |
137 |
] |
138 |
) |
139 |
|
140 |
if test -z "${LIBX86_LIBS}"; then |
141 |
AC_ARG_VAR([LIBX86_CFLAGS], [C compiler flags for libx86]) |
142 |
AC_ARG_VAR([LIBX86_LIBS], [linker flags for libx86]) |
143 |
AC_CHECK_LIB( |
144 |
[x86], |
145 |
[LRMI_common_init], |
146 |
[LIBX86_LIBS="-lx86"], |
147 |
[AC_MSG_ERROR([Required libx86 was not found])] |
148 |
) |
149 |
fi |
150 |
elif test "${ARCH}" = "ppc"; then |
151 |
AC_DEFINE([CONFIG_ARCH_PPC], [1], [Define if ppc arch]) |
152 |
fi |
153 |
|
154 |
if test "${enable_compress}" = "yes"; then |
155 |
AC_DEFINE([CONFIG_COMPRESS], [1], [Define if x86 arch]) |
156 |
if test -z "${LZO_LIBS}"; then |
157 |
AC_ARG_VAR([LZO_CFLAGS], [C compiler flags for lzo]) |
158 |
AC_ARG_VAR([LZO_LIBS], [linker flags for lzo]) |
159 |
AC_CHECK_LIB( |
160 |
[lzo2], |
161 |
[lzo1x_1_compress], |
162 |
[LZO_LIBS="-llzo2"], |
163 |
[AC_CHECK_LIB( |
164 |
[lzo], |
165 |
[lzo1x_1_compress], |
166 |
[LZO_LIBS="-llzo"], |
167 |
[AC_MSG_ERROR([Required lzo library not found])] |
168 |
)] |
169 |
) |
170 |
fi |
171 |
fi |
172 |
|
173 |
if test "${enable_encrypt}" = "yes"; then |
174 |
AC_DEFINE([CONFIG_ENCRYPT], [1], [Define if encryption enabled]) |
175 |
|
176 |
AC_MSG_CHECKING([for libgcrypt]) |
177 |
if ! test -x "${with_libgcrypt_prefix}/bin/libgcrypt-config"; then |
178 |
AC_MSG_ERROR([Cannot locate libgcrypt]) |
179 |
else |
180 |
AC_MSG_RESULT([found]) |
181 |
LIBGCRYPT_CFLAGS=`"${with_libgcrypt_prefix}/bin/libgcrypt-config" --cflags` |
182 |
LIBGCRYPT_LIBS=`"${with_libgcrypt_prefix}/bin/libgcrypt-config" --libs` |
183 |
fi |
184 |
fi |
185 |
|
186 |
if test "${enable_splashy}" = "yes"; then |
187 |
AC_DEFINE([CONFIG_SPLASHY], [1], [Define if splashy enabled]) |
188 |
|
189 |
if test -z "${SPLASHY_LIBS}"; then |
190 |
AC_ARG_VAR([SPLASHY_CFLAGS], [C compiler flags for libsplashy]) |
191 |
AC_ARG_VAR([SPLASHY_LIBS], [linker flags for libsplashy]) |
192 |
AC_CHECK_LIB( |
193 |
[splashy], |
194 |
[splashy_open], |
195 |
[SPLASHY_LIBS="-lsplashy"], |
196 |
[AC_MSG_ERROR([Required libsplashy was not found])] |
197 |
) |
198 |
fi |
199 |
fi |
200 |
|
201 |
AC_HEADER_STDC |
202 |
AC_CHECK_HEADERS([ \ |
203 |
inttypes.h \ |
204 |
stdint.h \ |
205 |
]) |
206 |
|
207 |
AC_SUBST([devdir]) |
208 |
AC_SUBST([initramfsdir]) |
209 |
AC_SUBST([bootdir]) |
210 |
AC_SUBST([LIBX86_CFLAGS]) |
211 |
AC_SUBST([LIBX86_LIBS]) |
212 |
AC_SUBST([LZO_CFLAGS]) |
213 |
AC_SUBST([LZO_LIBS]) |
214 |
AC_SUBST([LIBGCRYPT_CFLAGS]) |
215 |
AC_SUBST([LIBGCRYPT_LIBS]) |
216 |
AC_SUBST([SPLASHY_CFLAGS]) |
217 |
AC_SUBST([SPLASHY_LIBS]) |
218 |
AC_SUBST([RESUME_DEVICE]) |
219 |
AM_CONDITIONAL([ENABLE_DEBUG], [test "${enable_debug}" = "yes"]) |
220 |
AM_CONDITIONAL([ENABLE_MINIMAL], [test "${enable_minimal}" = "yes"]) |
221 |
AM_CONDITIONAL([ARCH_X86], [test "${ARCH}" = "x86"]) |
222 |
AM_CONDITIONAL([ARCH_PPC], [test "${ARCH}" = "ppc"]) |
223 |
AM_CONDITIONAL([ENABLE_ENCRYPT], [test "${enable_encrypt}" = "yes"]) |
224 |
AM_CONDITIONAL([ENABLE_RESUME_STATIC], [test "${enable_resume_static}" = "yes"]) |
225 |
AM_CONDITIONAL([ENABLE_CREATE_DEVICE], [test "${enable_create_device}" = "yes"]) |
226 |
AM_CONDITIONAL([ENABLE_SPLASHY], [test "${enable_splashy}" = "yes"]) |
227 |
AC_CONFIG_FILES([ |
228 |
Makefile |
229 |
doc/Makefile |
230 |
scripts/Makefile |
231 |
scripts/suse-10.1/Makefile |
232 |
]) |
233 |
AC_OUTPUT |
234 |
|