4
# Copyright (C) 2007 Alon Bar-Lev <alon.barlev@gmail.com>
6
# This file is released under the GPLv2.
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])
19
[AC_HELP_STRING([--enable-debug], [Enable debug mode])],
25
[AC_HELP_STRING([--enable-strict], [Enable strict compile mode])],
31
[AC_HELP_STRING([--enable-pedantic], [Enable pedantic compile mode])],
33
[enable_pedantic="no"]
37
[AC_HELP_STRING([--enable-minimal], [Enable minimal build])],
43
[AC_HELP_STRING([--enable-compress], [Enable compress support])],
45
[enable_compress="no"]
49
[AC_HELP_STRING([--enable-encrypt], [Enable encryption support])],
55
[AC_HELP_STRING([--enable-create-device], [Enable create required devices, use only if you don't have udev])],
57
[enable_create_device="no"]
61
[AC_HELP_STRING([--disable-resume-static], [Build resume as dynamic module])],
63
[enable_resume_static="yes"]
67
[AC_HELP_STRING([--enable-splashy], [Enable splashy support])],
73
[AC_HELP_STRING([--enable-fbsplash], [Enable fbsplash support])],
75
[enable_fbsplash="no"]
79
[AC_HELP_STRING([--with-devdir=DIR], [Use if --enable-create-device, put devices in this directory, default /dev])],
80
[devdir="${withval}"],
85
[AC_HELP_STRING([--with-initramfsdir=DIR], [Put initramfs binaries in this directory, default LIBDIR/suspend])],
86
[initramfsdir="${withval}"],
87
[initramfsdir="\$(libdir)/suspend"]
91
[AC_HELP_STRING([--with-libgcrypt-prefix=DIR], [Define libgcrypt prefix, default /usr])],
93
[with_libgcrypt_prefix="/usr" ]
97
[AC_HELP_STRING([--with-directfb-prefix=DIR], [Define directfb prefix, default /usr])],
99
[with_directfb_prefix="/usr" ]
103
[AC_HELP_STRING([--with-resume-device=DEVICE], [Define resume device (REQUIRED ONLY FOR BUILDING INITRAMFS DURING MAKE)])],
104
[RESUME_DEVICE="${withval}"]
108
[AC_HELP_STRING([--with-bootdir=DIR], [Define boot directory, default /boot (REQUIRED ONLY FOR BUILDING INITRAMFS DURING MAKE)])],
109
[bootdir="${withval}"],
116
AC_PROG_LIBTOOL # We are using libtool so it auto-find static dependencies
118
AC_CHECK_PROGS([M4], [m4])
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])
129
x86_*-*) ARCH="x86";;
130
ppc-*|powerpc-*) ARCH="ppc";;
131
ppc64-*|powerpc64-*) ARCH="ppc";;
136
if test "${ARCH}" = "x86"; then
137
AC_DEFINE([CONFIG_ARCH_X86], [1], [Define if x86 arch])
144
if test -z "${LIBPCI_LIBS}"; then
148
[LIBPCI_LIBS="-lpci"],
151
unset ac_cv_lib_pci_pci_init
155
[LIBPCI_LIBS="-lpci -lz"],
156
[AC_MSG_ERROR([Required pciutils >= 2.2.4 not found])],
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])
170
[LIBX86_LIBS="-lx86"],
171
[AC_MSG_ERROR([Required libx86 was not found])]
174
elif test "${ARCH}" = "ppc"; then
175
AC_DEFINE([CONFIG_ARCH_PPC], [1], [Define if ppc arch])
177
AC_MSG_ERROR([Unsupported architecture ${host}])
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])
194
[AC_MSG_ERROR([Required lzo library not found])]
200
if test "${enable_encrypt}" = "yes"; then
201
CONFIG_FEATURES="${CONFIG_FEATURES} encrypt"
202
AC_DEFINE([CONFIG_ENCRYPT], [1], [Define if encryption enabled])
204
AC_MSG_CHECKING([for libgcrypt])
205
if ! test -x "${with_libgcrypt_prefix}/bin/libgcrypt-config"; then
206
AC_MSG_ERROR([Cannot locate libgcrypt])
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`
214
if test "${enable_splashy}" = "yes"; then
215
CONFIG_FEATURES="${CONFIG_FEATURES} splashy"
216
AC_DEFINE([CONFIG_SPLASHY], [1], [Define if splashy enabled])
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])
224
[SPLASHY_LIBS="-lsplashy"],
225
[AC_MSG_ERROR([Required libsplashy was not found])]
230
if test "${enable_fbsplash}" = "yes"; then
231
CONFIG_FEATURES="${CONFIG_FEATURES} fbsplash"
232
AC_DEFINE([CONFIG_FBSPLASH], [1], [Define if fbsplash enabled])
236
[libfbsplashrender >= 0.1],
238
[AC_MSG_ERROR([Required libfbsplashrender was not found])]
242
AC_DEFINE_UNQUOTED([CONFIG_FEATURES], ["${CONFIG_FEATURES## }"], [String representation of available features])
250
if test "${enable_pedantic}" = "yes"; then
252
CFLAGS="${CFLAGS} -pedantic"
254
if test "${enable_strict}" = "yes"; then
255
CFLAGS="${CFLAGS} -Wall -Wextra"
258
# workaround for old autoconf
259
if test -z "${docdir}"; then
260
docdir="\$(datarootdir)/doc/\$(PACKAGE_NAME)"
266
AC_SUBST([initramfsdir])
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"])
284
scripts/suse-10.1/Makefile