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.4])
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([static-binaries],
80 AC_HELP_STRING([--disable-static-binaries], [do not build any statically linked binaries]),
82 AS_CASE(["${enableval}"],
83 [yes], [config_static_binaries="yes"],
84 [no], [config_static_binaries="no"],
85 [AC_MSG_ERROR([bad value '${enableval}' for --disable-static-binaries])]
88 [config_static_binaries="yes"]
90 AM_CONDITIONAL([CONFIG_STATIC_BINARIES], [test "x${config_static_binaries}" = "xyes"])
92 [test "x${config_static_binaries}" = "xyes"],
93 [AC_DEFINE([CONFIG_STATIC_BINARIES], [1], [Define to 1 to disable building of statically linked binaries.])]
96 AC_ARG_ENABLE([deprecated],
97 AC_HELP_STRING([--enable-deprecated], [include support for deprecated features]),
99 AS_CASE(["${enableval}"],
100 [yes], [config_deprecated="yes"],
101 [no], [config_deprecated="no"],
102 [AC_MSG_ERROR([bad value '${enableval}' for --enable-deprecated])]
105 [config_deprecated="no"]
107 AM_CONDITIONAL([CONFIG_DEPRECATED], [test "x${config_deprecated}" = "xyes"])
109 [test "x${config_deprecated}" = "xyes"],
110 [AC_DEFINE([CONFIG_DEPRECATED], [1], [Define to 1 to include support for deprecated features.])]
113 AC_ARG_ENABLE([fbcondecor],
114 AC_HELP_STRING([--disable-fbcondecor], [exclude support for fbcondecor]),
116 AS_CASE(["${enableval}"],
117 [yes], [config_fbcondecor="yes"],
118 [no], [config_fbcondecor="no"],
119 [AC_MSG_ERROR([bad value '${enableval}' for --enable-fbcondecor])]
122 [config_fbcondecor="yes"]
124 AM_CONDITIONAL([CONFIG_FBCON_DECOR], [test "x${config_fbcondecor}" = "xyes"])
126 [test "x${config_fbcondecor}" = "xyes"],
127 [AC_DEFINE([CONFIG_FBCON_DECOR], [1], [Define to 1 to include support for fbcondecor (previously called fbsplash).])]
130 AC_ARG_ENABLE([helper],
131 AC_HELP_STRING([--disable-helper], [do not build kernel helper]),
133 AS_CASE(["${enableval}"],
134 [yes], [config_helper="yes"],
135 [no], [config_helper="no"],
136 [AC_MSG_ERROR([bad value '${enableval}' for --enable-helper])]
139 [config_helper="yes"]
141 AM_CONDITIONAL([CONFIG_HELPER], [test "x${config_helper}" = "xyes"])
143 [test "x${config_helper}" = "xyes"],
144 [AC_DEFINE([CONFIG_HELPER], [1], [Define to 1 to build kernel helper.])]
147 AC_ARG_ENABLE([misc],
148 AC_HELP_STRING([--enable-misc], [build misc programs]),
150 AS_CASE(["${enableval}"],
151 [yes], [config_misc="yes"],
152 [no], [config_misc="no"],
153 [AC_MSG_ERROR([bad value '${enableval}' for --enable-misc])]
158 AM_CONDITIONAL([CONFIG_MISC], [test "x${config_misc}" = "xyes"])
160 [test "x${config_misc}" = "xyes"],
161 [AC_DEFINE([CONFIG_MISC], [1], [Define to 1 to build misc programs.])]
165 AC_HELP_STRING([--without-gpm], [exclude support for GPM]),
167 AS_CASE(["${withval}"],
168 [yes], [config_gpm="yes"],
169 [no], [config_gpm="no"],
170 [AC_MSG_ERROR([bad value '${withval}' for --with-gpm])]
175 AM_CONDITIONAL([CONFIG_GPM], [test "x${config_gpm}" = "xyes"])
177 [test "x${config_gpm}" = "xyes"],
178 [AC_DEFINE([CONFIG_GPM], [1], [Define to 1 to include support for GPM.])]
182 AC_HELP_STRING([--with-mng], [include support for MNG animations]),
184 AS_CASE(["${withval}"],
185 [yes], [config_mng="yes"],
186 [no], [config_mng="no"],
187 [AC_MSG_ERROR([bad value '${withval}' for --with-mng])]
192 AM_CONDITIONAL([CONFIG_MNG], [test "x${config_mng}" = "xyes"])
194 [test "x${config_mng}" = "xyes"],
195 [AC_DEFINE([CONFIG_MNG], [1], [Define to 1 to include support for MNG animations.])]
199 AC_HELP_STRING([--without-png], [exclude support for PNG images]),
201 AS_CASE(["${withval}"],
202 [yes], [config_png="yes"],
203 [no], [config_png="no"],
204 [AC_MSG_ERROR([bad value '${withval}' for --with-png])]
209 AM_CONDITIONAL([CONFIG_PNG], [test "x${config_png}" = "xyes"])
211 [test "x${config_png}" = "xyes"],
212 [AC_DEFINE([CONFIG_PNG], [1], [Define to 1 to include support for PNG images.])]
216 AC_HELP_STRING([--without-ttf], [exclude support for truetype fonts]),
218 AS_CASE(["${withval}"],
219 [yes], [config_ttf="yes"],
220 [no], [config_ttf="no"],
221 [AC_MSG_ERROR([bad value ${withval} for --with-ttf])]
226 AM_CONDITIONAL([CONFIG_TTF], [test "x${config_ttf}" = "xyes"])
228 [test "x${config_ttf}" = "xyes"],
229 [AC_DEFINE([CONFIG_TTF], [1], [Define to 1 to include support for truetype fonts.])]
232 AC_ARG_WITH([ttf-kernel],
233 AC_HELP_STRING([--without-ttf-kernel], [exclude support for truetype fonts in kernel helper]),
235 AS_CASE(["${withval}"],
236 [yes], [config_ttf_kernel="yes"],
237 [no], [config_ttf_kernel="no"],
238 [AC_MSG_ERROR([bad value ${withval} for --with-ttf-kernel])]
241 [config_ttf_kernel="yes"]
243 AM_CONDITIONAL([CONFIG_TTF_KERNEL], [test "x${config_ttf_kernel}" = "xyes"])
245 [test "x${config_ttf_kernel}" = "xyes"],
246 [AC_DEFINE([CONFIG_TTF_KERNEL], [1], [Define to 1 to include support for truetype fonts in kernel helper.])]
249 AC_ARG_WITH([klibc-compiler],
250 AS_HELP_STRING([--with-klibc-compiler], [compiler to use when building against klibc @<:@auto@:>@]),
254 [test "x${host_alias}" != "x${build_alias}"],
255 [AC_CHECK_PROG([KLCC], [${host_alias}-klcc], [${host_alias}-klcc])],
256 [AC_CHECK_PROG([KLCC], [klcc], [klcc])]
259 [test "x${KLCC}" = "x"],
260 [AC_MSG_WARN([could not determine compiler to use when building against klibc.])]
266 AC_ARG_WITH([freetype2-src],
267 AS_HELP_STRING([--with-freetype2-src=DIR], [freetype2 source to use when linking with klibc]),
270 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
271 [LIBFREETYPE2_SOURCE="\$(abs_top_srcdir)/${withval}"],
272 [LIBFREETYPE2_SOURCE="${withval}"]
275 [LIBFREETYPE2_SOURCE="\$(abs_top_srcdir)/\$(LIBFREETYPE2_SOURCE_INTERNAL)"]
277 AC_SUBST([LIBFREETYPE2_SOURCE])
279 AC_ARG_WITH([jpeg-src],
280 AS_HELP_STRING([--with-jpeg-src=DIR], [jpeglib source to use when linking with klibc]),
283 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
284 [LIBJPEG_SOURCE="\$(abs_top_srcdir)/${withval}"],
285 [LIBJPEG_SOURCE="${withval}"]
288 [LIBJPEG_SOURCE="\$(abs_top_srcdir)/\$(LIBJPEG_SOURCE_INTERNAL)"]
290 AC_SUBST([LIBJPEG_SOURCE])
292 AC_ARG_WITH([lpng-src],
293 AS_HELP_STRING([--with-lpng-src=DIR], [libpng source to use when linking with klibc]),
296 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
297 [LIBPNG_SOURCE="\$(abs_top_srcdir)/${withval}"],
298 [LIBPNG_SOURCE="${withval}"]
301 [LIBPNG_SOURCE="\$(abs_top_srcdir)/\$(LIBPNG_SOURCE_INTERNAL)"]
303 AC_SUBST([LIBPNG_SOURCE])
305 AC_ARG_WITH([zlib-src],
306 AS_HELP_STRING([--with-zlib-src=DIR], [zlib source to use when linking with klibc]),
309 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
310 [LIBZ_SOURCE="\$(abs_top_srcdir)/${withval}"],
311 [LIBZ_SOURCE="${withval}"]
314 [LIBZ_SOURCE="\$(abs_top_srcdir)/\$(LIBZ_SOURCE_INTERNAL)"]
316 AC_SUBST([LIBZ_SOURCE])
318 AC_ARG_WITH([essential-prefix],
319 AS_HELP_STRING([--with-essential-prefix=ESPREFIX], [install essential files in ESPREFIX @<:@/@:>@]),
320 [essential_prefix="$(echo ${withval} | sed -e 's#/$##')"],
321 [essential_prefix="/"]
323 AC_SUBST([essential_prefix])
325 AC_ARG_WITH([essential-bindir],
326 AS_HELP_STRING([--with-essential-bindir=DIR], [essential user apps directory @<:@ESPREFIX/bin@:>@]),
327 [eexecbindir="${withval}"],
328 [eexecbindir="\$(essential_prefix)/bin"]
330 AC_SUBST([eexecbindir])
332 AC_ARG_WITH([essential-sbindir],
333 AS_HELP_STRING([--with-eseential-sbindir=DIR], [essential admin apps directory @<:@ESPREFIX/sbin@:>@]),
334 [eexecsbindir="${withval}"],
335 [eexecsbindir="\$(essential_prefix)/sbin"]
337 AC_SUBST([eexecsbindir])
339 AC_ARG_WITH([essential-libdir],
340 AS_HELP_STRING([--with-essential-libdir=DIR], [essential libraries directory @<:@ESPREFIX/lib@:>@]),
341 [eexeclibdir="${withval}"],
342 [eexeclibdir="\$(essential_prefix)/lib"]
344 AC_SUBST([eexeclibdir])
346 AC_ARG_WITH([themedir],
347 AS_HELP_STRING([--with-themedir=DIR], [splash theme directory @<:@ESPREFIX/etc/splash@:>@]),
348 [themedir="${withval}"],
349 [themedir="\$(essential_prefix)/etc/splash"]
354 AC_HELP_STRING([--without-klibc], [link the kernel helper against glibc instead of klibc]),
356 AS_CASE(["${withval}"],
357 [yes], [config_klibc="yes"],
358 [no], [config_klibc="no"],
359 [AC_MSG_ERROR([bad value ${withval} for --with-klibc])]
364 AM_CONDITIONAL([CONFIG_KLIBC], [test "x${config_klibc}" = "xyes"])
366 [test "x${config_klibc}" = "xyes"],
367 [AC_DEFINE([CONFIG_KLIBC], [1], [use klibc])]
374 [M_CFLAGS="${M_CFLAGS}"],
375 [AC_MSG_ERROR(['math.h' header file not found.])]
379 [M_LIBS="${M_LIBS} -lm"],
380 [AC_MSG_ERROR(['libm' library not found.])]
389 [RT_CFLAGS="${RT_CFLAGS}"],
390 [AC_MSG_ERROR(['time.h' header file was not found.])]
392 AC_CHECK_LIB([rt], [clock_gettime],
393 [RT_LIBS="${RT_LIBS} -lrt"],
394 [AC_MSG_ERROR(['librt' library was not found.])]
396 AC_SUBST([RT_CFLAGS])
401 AC_CHECK_HEADER([pthread.h],
402 [PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"],
403 [AC_MSG_ERROR(['pthread.h' header file was not found.])]
405 AC_CHECK_LIB([pthread], [pthread_create],
406 [PTHREAD_LIBS="${PTHREAD_LIBS} -lpthread"],
407 [AC_MSG_ERROR(['libpthread' library file was not found.])]
409 AC_SUBST([PTHREAD_CFLAGS])
410 AC_SUBST([PTHREAD_LIBS])
412 PTHREAD_STATIC_CFLFAGS=
416 [PTHREAD_STATIC_CFLFAGS="${PTHREAD_STATIC_CFLFAGS}"],
417 [AC_MSG_ERROR(['pthread.h' header file was not found.])]
419 AC_CHECK_LIB([pthread], [xxpthread_create],
420 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -lpthread"],
422 AC_CHECK_LIB([pthread], [pthread_create],
423 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -L\$(DESTDIR)\$(libdir)/nptl -lpthread"],
425 AC_CHECK_LIB([pthread], [pthread_create],
426 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -L\$(DESTDIR)\$(elibdir)/nptl -lpthread"],
427 [AC_MSG_ERROR([the required 'libpthread' static library file not found.])],
428 [-static -L${DESTDIR}${elibdir}/nptl]
431 [-static -L${DESTDIR}${libdir}/nptl]
436 AC_SUBST([PTHREAD_STATIC_CFLAGS])
437 AC_SUBST([PTHREAD_STATIC_LIBS])
439 AC_ARG_VAR([JPEG_CFLAGS], [C compiler flags for JPEG library, overriding autodetection])
440 AC_ARG_VAR([JPEG_LIBS], [linker flags for JPEG library, overriding autodetection])
442 [test "x${JPEG_CFLAGS}" = "x"],
444 AC_CHECK_HEADER([jpeglib.h],
445 [JPEG_CFLAGS="${JPEG_CFLAGS}"],
446 [AC_MSG_ERROR(['jpeglib.h' header file not found.])]
451 [test "x${JPEG_CFLAGS}" = "no"],
455 [test "x${JPEG_LIBS}" = "x"],
457 AC_CHECK_LIB([jpeg], [jpeg_set_defaults],
458 [JPEG_LIBS="${JPEG_LIBS} -ljpeg"],
459 [AC_MSG_ERROR([the required 'libjpeg' library file was not found.])]
464 [test "x${JPEG_LIBS}" = "no"],
467 AC_SUBST([JPEG_CFLAGS])
468 AC_SUBST([JPEG_LIBS])
470 # As needed, check GPM files and set GPM compiler flags.
471 AC_ARG_VAR([GPM_CFLAGS], [C compiler flags for GPM library, overriding autodetection])
472 AC_ARG_VAR([GPM_LIBS], [linker flags for GPM library, overriding autodetection])
474 [test "x${config_gpm}" = "xyes"],
477 [test "x${GPM_CFLAGS}" = "x"],
481 [GPM_CFLAGS="${GPM_CFLAGS}"],
482 [AC_MSG_ERROR(['gpm.h' header file was not found.])]
487 [test "x${GPM_CFLAGS}" = "no"],
491 [test "x${GPM_LIBS}" = "x"],
495 [GPM_LIBS="${GPM_LIBS} -lgpm"],
496 [AC_MSG_ERROR(['libgpm' library file was not found.])]
501 [test "x${GPM_LIBS}" = "no"],
506 AC_SUBST([GPM_CFLAGS])
509 AC_ARG_VAR([MNG_CFLAGS], [C compiler flags for MNG library, overriding autodetection])
510 AC_ARG_VAR([MNG_LIBS], [linker flags for MNG library, overriding autodetection])
512 [test "x${config_mng}" = "xyes"],
515 [test "x${MNG_CFLAGS}" = "x"],
520 MNG_CFLAGS="${MNG_CFLAGS}"
521 MNG_CFLAGS="${MNG_CFLAGS} ${JPEG_CFLAGS}"
522 MNG_CFLAGS="${MNG_CFLAGS} ${RT_CFLAGS}"
524 [AC_MSG_ERROR(['libmng.h' header file was not found.])]
529 [test "x${MNG_CFLAGS}" = "xno"],
533 [test "x${MNG_LIBS}" = "x"],
536 [mng], [mng_initialize],
538 MNG_LIBS="${MNG_LIBS} -lmng"
539 MNG_LIBS="${MNG_LIBS} ${JPEG_LIBS}"
540 AC_CHECK_LIB([z], [zlibVersion], [MNG_LIBS="${MNG_LIBS} -lz" ])
541 AC_CHECK_LIB([lcms], [cmsCloseProfile],[MNG_LIBS="${MNG_LIBS} -llcms"])
543 [AC_MSG_ERROR(['libmng' library file was not found.])]
548 [test "x${MNG_LIBS}" = "xno"],
553 AC_SUBST([MNG_CFLAGS])
556 AC_ARG_VAR([PNG_CFLAGS], [C compiler flags for PNG library, overriding autodetection])
557 AC_ARG_VAR([PNG_LIBS], [linker flags for PNG library, overriding autodetection])
560 [test "x${config_png}" = "xyes"],
563 [test "x${LIBPNG_CONFIG}" = "x"],
564 [AC_PATH_PROG(LIBPNG_CONFIG, libpng-config)]
567 [test "x${LIBPNG_CONFIG}" = "xno"],
571 [test "x${PNG_CFLAGS}" = "x"],
574 [test "x$LIBPNG_CONFIG" != "x"],
575 [PNG_CFLAGS=$(${LIBPNG_CONFIG} --static --cflags)],
577 AC_CHECK_HEADER([png.h],
578 [PNG_CFLAGS="${PNG_CFLAGS}"],
579 [AC_MSG_ERROR(['png.h' header file not found.])]
586 [test "x${PNG_CFLAGS}" = "xno"],
590 [test "x${PNG_LIBS}" = "x"],
593 [test "x$LIBPNG_CONFIG" != "x"],
594 [PNG_LIBS=$(${LIBPNG_CONFIG} --static --libs)],
596 AC_CHECK_LIB([png], [png_access_version_number],
598 PNG_LIBS="${PNG_LIBS} -lpng"
599 AC_CHECK_LIB([z], [zlibVersion],
600 [PNG_LIBS="${PNG_LIBS} -lz"]
602 PNG_LIBS="${PNG_LIBS} ${M_LIBS}"
604 [AC_MSG_ERROR(['libpng' library file not found.])]
611 [test "x${PNG_LIBS}" = "xno"],
616 AC_SUBST([PNG_CFLAGS])
620 [test "x${config_ttf}" = "xyes"],
626 [AC_MSG_ERROR([freetype was not found.])]
631 AH_TOP([#ifndef __SPLASH_CONFIG_H
632 #define __SPLASH_CONFIG_H])
633 AH_BOTTOM([#endif /* SPLASH_CONFIG_H */])
635 AC_CONFIG_HEADERS([config.h])
636 AC_CONFIG_FILES([Makefile src/Makefile libs/Makefile misc/Makefile src/test/Makefile docs/Makefile scripts/Makefile])