1 ################################################################################
2 # autoconf file for generating the splashutils' configure file.
4 # Copyright (c) 2006-2007, Michal Januszewski <spock@gentoo.org>
5 # Copyright (c) 2007, Paul Bender <pebender@gmail.com>
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 ################################################################################
18 AC_INIT([splashutils], [1.5.4.1])
20 AC_SUBST([libfbsplash_version], [1:0:0])
21 AC_SUBST([libfbsplashrender_version], [1:0:0])
23 AM_INIT_AUTOMAKE([1.10 -Wno-portability])
24 AC_CONFIG_MACRO_DIR([m4])
35 [test "x${BUILD_CC}" = "x" && test "x${build_alias}" != "x"],
36 [AC_CHECK_PROG([BUILD_CC], [${build_alias}-gcc], [${build_alias}-gcc])]
39 [test "x${BUILD_CC}" = "x"],
40 [AC_CHECK_PROG([BUILD_CC], [gcc], [gcc])]
43 [test "x${BUILD_CC}" = "x"],
44 [AC_CHECK_PROG([BUILD_CC], [cc], [cc])]
47 [test "x${BUILD_CC}" = "x"],
51 AC_PREFIX_DEFAULT([/usr])
53 AC_ARG_ENABLE([debug],
54 AS_HELP_STRING([--enable-debug], [do not strip files]),
56 AS_CASE(["${enableval}"],
57 [yes], [config_debug="yes"],
58 [no], [config_debug="no"],
59 [AC_MSG_ERROR([bad value '${enableval}' for --enable-debug])]
64 AM_CONDITIONAL([CONFIG_DEBUG], [test "x${config_debug}" = "xyes"])
66 AC_ARG_ENABLE([klibc-shared],
67 AS_HELP_STRING([--enable-klibc-shared], [link to shared klibc]),
69 AS_CASE(["${enableval}"],
70 [yes], [config_klibc_shared="yes"],
71 [no], [config_klibc_shared="no"],
72 [AC_MSG_ERROR([bad value '${enableval}' for --enable-klibc-shared])]
75 [config_klibc_shared="no"]
77 AM_CONDITIONAL([CONFIG_KLIBC_SHARED], [test "x${config_klibc_shared}" = "xyes"])
79 AC_ARG_ENABLE([deprecated],
80 AC_HELP_STRING([--enable-deprecated], [include support for deprecated features]),
82 AS_CASE(["${enableval}"],
83 [yes], [config_deprecated="yes"],
84 [no], [config_deprecated="no"],
85 [AC_MSG_ERROR([bad value '${enableval}' for --enable-deprecated])]
88 [config_deprecated="no"]
90 AM_CONDITIONAL([CONFIG_DEPRECATED], [test "x${config_deprecated}" = "xyes"])
92 [test "x${config_deprecated}" = "xyes"],
93 [AC_DEFINE([CONFIG_DEPRECATED], [1], [Define to 1 to include support for deprecated features.])]
96 AC_ARG_ENABLE([fbcondecor],
97 AC_HELP_STRING([--disable-fbcondecor], [exclude support for fbcondecor]),
99 AS_CASE(["${enableval}"],
100 [yes], [config_fbcondecor="yes"],
101 [no], [config_fbcondecor="no"],
102 [AC_MSG_ERROR([bad value '${enableval}' for --enable-fbcondecor])]
105 [config_fbcondecor="yes"]
107 AM_CONDITIONAL([CONFIG_FBCON_DECOR], [test "x${config_fbcondecor}" = "xyes"])
109 [test "x${config_fbcondecor}" = "xyes"],
110 [AC_DEFINE([CONFIG_FBCON_DECOR], [1], [Define to 1 to include support for fbcondecor (previously called fbsplash).])]
113 AC_ARG_ENABLE([helper],
114 AC_HELP_STRING([--disable-helper], [do not build kernel helper]),
116 AS_CASE(["${enableval}"],
117 [yes], [config_helper="yes"],
118 [no], [config_helper="no"],
119 [AC_MSG_ERROR([bad value '${enableval}' for --enable-helper])]
122 [config_helper="yes"]
124 AM_CONDITIONAL([CONFIG_HELPER], [test "x${config_helper}" = "xyes"])
126 [test "x${config_helper}" = "xyes"],
127 [AC_DEFINE([CONFIG_HELPER], [1], [Define to 1 to build kernel helper.])]
130 AC_ARG_ENABLE([misc],
131 AC_HELP_STRING([--enable-misc], [build misc programs]),
133 AS_CASE(["${enableval}"],
134 [yes], [config_misc="yes"],
135 [no], [config_misc="no"],
136 [AC_MSG_ERROR([bad value '${enableval}' for --enable-misc])]
141 AM_CONDITIONAL([CONFIG_MISC], [test "x${config_misc}" = "xyes"])
143 [test "x${config_misc}" = "xyes"],
144 [AC_DEFINE([CONFIG_MISC], [1], [Define to 1 to build misc programs.])]
148 AC_HELP_STRING([--without-gpm], [exclude support for GPM]),
150 AS_CASE(["${withval}"],
151 [yes], [config_gpm="yes"],
152 [no], [config_gpm="no"],
153 [AC_MSG_ERROR([bad value '${withval}' for --with-gpm])]
158 AM_CONDITIONAL([CONFIG_GPM], [test "x${config_gpm}" = "xyes"])
160 [test "x${config_gpm}" = "xyes"],
161 [AC_DEFINE([CONFIG_GPM], [1], [Define to 1 to include support for GPM.])]
165 AC_HELP_STRING([--with-mng], [include support for MNG animations]),
167 AS_CASE(["${withval}"],
168 [yes], [config_mng="yes"],
169 [no], [config_mng="no"],
170 [AC_MSG_ERROR([bad value '${withval}' for --with-mng])]
175 AM_CONDITIONAL([CONFIG_MNG], [test "x${config_mng}" = "xyes"])
177 [test "x${config_mng}" = "xyes"],
178 [AC_DEFINE([CONFIG_MNG], [1], [Define to 1 to include support for MNG animations.])]
182 AC_HELP_STRING([--without-png], [exclude support for PNG images]),
184 AS_CASE(["${withval}"],
185 [yes], [config_png="yes"],
186 [no], [config_png="no"],
187 [AC_MSG_ERROR([bad value '${withval}' for --with-png])]
192 AM_CONDITIONAL([CONFIG_PNG], [test "x${config_png}" = "xyes"])
194 [test "x${config_png}" = "xyes"],
195 [AC_DEFINE([CONFIG_PNG], [1], [Define to 1 to include support for PNG images.])]
199 AC_HELP_STRING([--without-ttf], [exclude support for truetype fonts]),
201 AS_CASE(["${withval}"],
202 [yes], [config_ttf="yes"],
203 [no], [config_ttf="no"],
204 [AC_MSG_ERROR([bad value ${withval} for --with-ttf])]
209 AM_CONDITIONAL([CONFIG_TTF], [test "x${config_ttf}" = "xyes"])
211 [test "x${config_ttf}" = "xyes"],
212 [AC_DEFINE([CONFIG_TTF], [1], [Define to 1 to include support for truetype fonts.])]
215 AC_ARG_WITH([ttf-kernel],
216 AC_HELP_STRING([--without-ttf-kernel], [exclude support for truetype fonts in kernel helper]),
218 AS_CASE(["${withval}"],
219 [yes], [config_ttf_kernel="yes"],
220 [no], [config_ttf_kernel="no"],
221 [AC_MSG_ERROR([bad value ${withval} for --with-ttf-kernel])]
224 [config_ttf_kernel="yes"]
226 AM_CONDITIONAL([CONFIG_TTF_KERNEL], [test "x${config_ttf_kernel}" = "xyes"])
228 [test "x${config_ttf_kernel}" = "xyes"],
229 [AC_DEFINE([CONFIG_TTF_KERNEL], [1], [Define to 1 to include support for truetype fonts in kernel helper.])]
232 AC_ARG_WITH([klibc-compiler],
233 AS_HELP_STRING([--with-klibc-compiler], [compiler to use when building against klibc @<:@auto@:>@]),
237 [test "x${host_alias}" != "x${build_alias}"],
238 [AC_CHECK_PROG([KLCC], [${host_alias}-klcc], [${host_alias}-klcc])],
239 [AC_CHECK_PROG([KLCC], [klcc], [klcc])]
242 [test "x${KLCC}" = "x"],
243 [AC_MSG_WARN([could not determine compiler to use when building against klibc.])]
249 AC_ARG_WITH([freetype2-src],
250 AS_HELP_STRING([--with-freetype2-src=DIR], [freetype2 source to use when linking with klibc]),
253 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
254 [LIBFREETYPE2_SOURCE="\$(abs_top_srcdir)/${withval}"],
255 [LIBFREETYPE2_SOURCE="${withval}"]
258 [LIBFREETYPE2_SOURCE="\$(abs_top_srcdir)/\$(LIBFREETYPE2_SOURCE_INTERNAL)"]
260 AC_SUBST([LIBFREETYPE2_SOURCE])
262 AC_ARG_WITH([jpeg-src],
263 AS_HELP_STRING([--with-jpeg-src=DIR], [jpeglib source to use when linking with klibc]),
266 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
267 [LIBJPEG_SOURCE="\$(abs_top_srcdir)/${withval}"],
268 [LIBJPEG_SOURCE="${withval}"]
271 [LIBJPEG_SOURCE="\$(abs_top_srcdir)/\$(LIBJPEG_SOURCE_INTERNAL)"]
273 AC_SUBST([LIBJPEG_SOURCE])
275 AC_ARG_WITH([lpng-src],
276 AS_HELP_STRING([--with-lpng-src=DIR], [libpng source to use when linking with klibc]),
279 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
280 [LIBPNG_SOURCE="\$(abs_top_srcdir)/${withval}"],
281 [LIBPNG_SOURCE="${withval}"]
284 [LIBPNG_SOURCE="\$(abs_top_srcdir)/\$(LIBPNG_SOURCE_INTERNAL)"]
286 AC_SUBST([LIBPNG_SOURCE])
288 AC_ARG_WITH([zlib-src],
289 AS_HELP_STRING([--with-zlib-src=DIR], [zlib source to use when linking with klibc]),
292 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
293 [LIBZ_SOURCE="\$(abs_top_srcdir)/${withval}"],
294 [LIBZ_SOURCE="${withval}"]
297 [LIBZ_SOURCE="\$(abs_top_srcdir)/\$(LIBZ_SOURCE_INTERNAL)"]
299 AC_SUBST([LIBZ_SOURCE])
301 AC_ARG_WITH([essential-prefix],
302 AS_HELP_STRING([--with-essential-prefix=ESPREFIX], [install essential files in ESPREFIX @<:@/@:>@]),
303 [essential_prefix="$(echo ${withval} | sed -e 's#/$##')"],
304 [essential_prefix="/"]
306 AC_SUBST([essential_prefix])
308 AC_ARG_WITH([essential-bindir],
309 AS_HELP_STRING([--with-essential-bindir=DIR], [essential user apps directory @<:@ESPREFIX/bin@:>@]),
310 [eexecbindir="${withval}"],
311 [eexecbindir="\$(essential_prefix)/bin"]
313 AC_SUBST([eexecbindir])
315 AC_ARG_WITH([essential-sbindir],
316 AS_HELP_STRING([--with-eseential-sbindir=DIR], [essential admin apps directory @<:@ESPREFIX/sbin@:>@]),
317 [eexecsbindir="${withval}"],
318 [eexecsbindir="\$(essential_prefix)/sbin"]
320 AC_SUBST([eexecsbindir])
322 AC_ARG_WITH([essential-libdir],
323 AS_HELP_STRING([--with-essential-libdir=DIR], [essential libraries directory @<:@ESPREFIX/lib@:>@]),
324 [eexeclibdir="${withval}"],
325 [eexeclibdir="\$(essential_prefix)/lib"]
327 AC_SUBST([eexeclibdir])
329 AC_ARG_WITH([themedir],
330 AS_HELP_STRING([--with-themedir=DIR], [splash theme directory @<:@ESPREFIX/etc/splash@:>@]),
331 [themedir="${withval}"],
332 [themedir="\$(essential_prefix)/etc/splash"]
340 [M_CFLAGS="${M_CFLAGS}"],
341 [AC_MSG_ERROR(['math.h' header file not found.])]
345 [M_LIBS="${M_LIBS} -lm"],
346 [AC_MSG_ERROR(['libm' library not found.])]
355 [RT_CFLAGS="${RT_CFLAGS}"],
356 [AC_MSG_ERROR(['time.h' header file was not found.])]
358 AC_CHECK_LIB([rt], [clock_gettime],
359 [RT_LIBS="${RT_LIBS} -lrt"],
360 [AC_MSG_ERROR(['librt' library was not found.])]
362 AC_SUBST([RT_CFLAGS])
367 AC_CHECK_HEADER([pthread.h],
368 [PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"],
369 [AC_MSG_ERROR(['pthread.h' header file was not found.])]
371 AC_CHECK_LIB([pthread], [pthread_create],
372 [PTHREAD_LIBS="${PTHREAD_LIBS} -lpthread"],
373 [AC_MSG_ERROR(['libpthread' library file was not found.])]
375 AC_SUBST([PTHREAD_CFLAGS])
376 AC_SUBST([PTHREAD_LIBS])
378 PTHREAD_STATIC_CFLFAGS=
382 [PTHREAD_STATIC_CFLFAGS="${PTHREAD_STATIC_CFLFAGS}"],
383 [AC_MSG_ERROR(['pthread.h' header file was not found.])]
385 AC_CHECK_LIB([pthread], [xxpthread_create],
386 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -lpthread"],
388 AC_CHECK_LIB([pthread], [pthread_create],
389 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -L\$(DESTDIR)\$(libdir)/nptl -lpthread"],
391 AC_CHECK_LIB([pthread], [pthread_create],
392 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -L\$(DESTDIR)\$(elibdir)/nptl -lpthread"],
393 [AC_MSG_ERROR([the required 'libpthread' static library file not found.])],
394 [-static -L${DESTDIR}${elibdir}/nptl]
397 [-static -L${DESTDIR}${libdir}/nptl]
402 AC_SUBST([PTHREAD_STATIC_CFLAGS])
403 AC_SUBST([PTHREAD_STATIC_LIBS])
405 AC_ARG_VAR([JPEG_CFLAGS], [C compiler flags for JPEG library, overriding autodetection])
406 AC_ARG_VAR([JPEG_LIBS], [linker flags for JPEG library, overriding autodetection])
408 [test "x${JPEG_CFLAGS}" = "x"],
410 AC_CHECK_HEADER([jpeglib.h],
411 [JPEG_CFLAGS="${JPEG_CFLAGS}"],
412 [AC_MSG_ERROR(['jpeglib.h' header file not found.])]
417 [test "x${JPEG_CFLAGS}" = "no"],
421 [test "x${JPEG_LIBS}" = "x"],
423 AC_CHECK_LIB([jpeg], [jpeg_set_defaults],
424 [JPEG_LIBS="${JPEG_LIBS} -ljpeg"],
425 [AC_MSG_ERROR([the required 'libjpeg' library file was not found.])]
430 [test "x${JPEG_LIBS}" = "no"],
433 AC_SUBST([JPEG_CFLAGS])
434 AC_SUBST([JPEG_LIBS])
436 # As needed, check GPM files and set GPM compiler flags.
437 AC_ARG_VAR([GPM_CFLAGS], [C compiler flags for GPM library, overriding autodetection])
438 AC_ARG_VAR([GPM_LIBS], [linker flags for GPM library, overriding autodetection])
440 [test "x${config_gpm}" = "xyes"],
443 [test "x${GPM_CFLAGS}" = "x"],
447 [GPM_CFLAGS="${GPM_CFLAGS}"],
448 [AC_MSG_ERROR(['gpm.h' header file was not found.])]
453 [test "x${GPM_CFLAGS}" = "no"],
457 [test "x${GPM_LIBS}" = "x"],
461 [GPM_LIBS="${GPM_LIBS} -lgpm"],
462 [AC_MSG_ERROR(['libgpm' library file was not found.])]
467 [test "x${GPM_LIBS}" = "no"],
472 AC_SUBST([GPM_CFLAGS])
475 AC_ARG_VAR([MNG_CFLAGS], [C compiler flags for MNG library, overriding autodetection])
476 AC_ARG_VAR([MNG_LIBS], [linker flags for MNG library, overriding autodetection])
478 [test "x${config_mng}" = "xyes"],
481 [test "x${MNG_CFLAGS}" = "x"],
486 MNG_CFLAGS="${MNG_CFLAGS}"
487 MNG_CFLAGS="${MNG_CFLAGS} ${JPEG_CFLAGS}"
488 MNG_CFLAGS="${MNG_CFLAGS} ${RT_CFLAGS}"
490 [AC_MSG_ERROR(['libmng.h' header file was not found.])]
495 [test "x${MNG_CFLAGS}" = "xno"],
499 [test "x${MNG_LIBS}" = "x"],
502 [mng], [mng_initialize],
504 MNG_LIBS="${MNG_LIBS} -lmng"
505 MNG_LIBS="${MNG_LIBS} ${JPEG_LIBS}"
506 AC_CHECK_LIB([z], [zlibVersion], [MNG_LIBS="${MNG_LIBS} -lz" ])
507 AC_CHECK_LIB([lcms], [cmsCloseProfile],[MNG_LIBS="${MNG_LIBS} -llcms"])
509 [AC_MSG_ERROR(['libmng' library file was not found.])]
514 [test "x${MNG_LIBS}" = "xno"],
519 AC_SUBST([MNG_CFLAGS])
522 AC_ARG_VAR([PNG_CFLAGS], [C compiler flags for PNG library, overriding autodetection])
523 AC_ARG_VAR([PNG_LIBS], [linker flags for PNG library, overriding autodetection])
526 [test "x${config_png}" = "xyes"],
529 [test "x${LIBPNG_CONFIG}" = "x"],
530 [AC_PATH_PROG(LIBPNG_CONFIG, libpng-config)]
533 [test "x${LIBPNG_CONFIG}" = "xno"],
537 [test "x${PNG_CFLAGS}" = "x"],
540 [test "x$LIBPNG_CONFIG" != "x"],
541 [PNG_CFLAGS=$(${LIBPNG_CONFIG} --static --cflags)],
543 AC_CHECK_HEADER([png.h],
544 [PNG_CFLAGS="${PNG_CFLAGS}"],
545 [AC_MSG_ERROR(['png.h' header file not found.])]
552 [test "x${PNG_CFLAGS}" = "xno"],
556 [test "x${PNG_LIBS}" = "x"],
559 [test "x$LIBPNG_CONFIG" != "x"],
560 [PNG_LIBS=$(${LIBPNG_CONFIG} --static --libs)],
562 AC_CHECK_LIB([png], [png_access_version_number],
564 PNG_LIBS="${PNG_LIBS} -lpng"
565 AC_CHECK_LIB([z], [zlibVersion],
566 [PNG_LIBS="${PNG_LIBS} -lz"]
568 PNG_LIBS="${PNG_LIBS} ${M_LIBS}"
570 [AC_MSG_ERROR(['libpng' library file not found.])]
577 [test "x${PNG_LIBS}" = "xno"],
582 AC_SUBST([PNG_CFLAGS])
586 [test "x${config_ttf}" = "xyes"],
592 [AC_MSG_ERROR([freetype was not found.])]
597 AH_TOP([#ifndef __SPLASH_CONFIG_H
598 #define __SPLASH_CONFIG_H])
599 AH_BOTTOM([#endif /* SPLASH_CONFIG_H */])
601 AC_CONFIG_HEADERS([config.h])
602 AC_CONFIG_FILES([Makefile src/Makefile libs/Makefile misc/Makefile src/test/Makefile docs/Makefile scripts/Makefile])