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])
20 AC_SUBST([libfbsplash_version], [1:0:0])
21 AC_SUBST([libfbsplashrender_version], [1:0:0])
23 AM_INIT_AUTOMAKE([1.10 -Wno-portability])
34 [test "x${BUILD_CC}" = "x" && test "x${build_alias}" != "x"],
35 [AC_CHECK_PROG([BUILD_CC], [${build_alias}-gcc], [${build_alias}-gcc])]
38 [test "x${BUILD_CC}" = "x"],
39 [AC_CHECK_PROG([BUILD_CC], [gcc], [gcc])]
42 [test "x${BUILD_CC}" = "x"],
43 [AC_CHECK_PROG([BUILD_CC], [cc], [cc])]
46 [test "x${BUILD_CC}" = "x"],
50 AC_PREFIX_DEFAULT([/usr])
52 AC_ARG_ENABLE([debug],
53 AS_HELP_STRING([--enable-debug], [do not strip files]),
55 AS_CASE(["${enableval}"],
56 [yes], [config_debug="yes"],
57 [no], [config_debug="no"],
58 [AC_MSG_ERROR([bad value '${enableval}' for --enable-debug])]
63 AM_CONDITIONAL([CONFIG_DEBUG], [test "x${config_debug}" = "xyes"])
65 AC_ARG_ENABLE([klibc-shared],
66 AS_HELP_STRING([--enable-klibc-shared], [link to shared klibc]),
68 AS_CASE(["${enableval}"],
69 [yes], [config_klibc_shared="yes"],
70 [no], [config_klibc_shared="no"],
71 [AC_MSG_ERROR([bad value '${enableval}' for --enable-klibc-shared])]
74 [config_klibc_shared="no"]
76 AM_CONDITIONAL([CONFIG_KLIBC_SHARED], [test "x${config_klibc_shared}" = "xyes"])
78 AC_ARG_ENABLE([deprecated],
79 AC_HELP_STRING([--enable-deprecated], [include support for deprecated features]),
81 AS_CASE(["${enableval}"],
82 [yes], [config_deprecated="yes"],
83 [no], [config_deprecated="no"],
84 [AC_MSG_ERROR([bad value '${enableval}' for --enable-deprecated])]
87 [config_deprecated="no"]
89 AM_CONDITIONAL([CONFIG_DEPRECATED], [test "x${config_deprecated}" = "xyes"])
91 [test "x${config_deprecated}" = "xyes"],
92 [AC_DEFINE([CONFIG_DEPRECATED], [1], [Define to 1 to include support for deprecated features.])]
95 AC_ARG_ENABLE([fbcondecor],
96 AC_HELP_STRING([--disable-fbcondecor], [exclude support for fbcondecor]),
98 AS_CASE(["${enableval}"],
99 [yes], [config_fbcondecor="yes"],
100 [no], [config_fbcondecor="no"],
101 [AC_MSG_ERROR([bad value '${enableval}' for --enable-fbcondecor])]
104 [config_fbcondecor="yes"]
106 AM_CONDITIONAL([CONFIG_FBCON_DECOR], [test "x${config_fbcondecor}" = "xyes"])
108 [test "x${config_fbcondecor}" = "xyes"],
109 [AC_DEFINE([CONFIG_FBCON_DECOR], [1], [Define to 1 to include support for fbcondecor (previously called fbsplash).])]
112 AC_ARG_ENABLE([helper],
113 AC_HELP_STRING([--disable-helper], [do not build kernel helper]),
115 AS_CASE(["${enableval}"],
116 [yes], [config_helper="yes"],
117 [no], [config_helper="no"],
118 [AC_MSG_ERROR([bad value '${enableval}' for --enable-helper])]
121 [config_helper="yes"]
123 AM_CONDITIONAL([CONFIG_HELPER], [test "x${config_helper}" = "xyes"])
125 [test "x${config_helper}" = "xyes"],
126 [AC_DEFINE([CONFIG_HELPER], [1], [Define to 1 to build kernel helper.])]
129 AC_ARG_ENABLE([misc],
130 AC_HELP_STRING([--enable-misc], [build misc programs]),
132 AS_CASE(["${enableval}"],
133 [yes], [config_misc="yes"],
134 [no], [config_misc="no"],
135 [AC_MSG_ERROR([bad value '${enableval}' for --enable-misc])]
140 AM_CONDITIONAL([CONFIG_MISC], [test "x${config_misc}" = "xyes"])
142 [test "x${config_misc}" = "xyes"],
143 [AC_DEFINE([CONFIG_MISC], [1], [Define to 1 to build misc programs.])]
147 AC_HELP_STRING([--without-gpm], [exclude support for GPM]),
149 AS_CASE(["${withval}"],
150 [yes], [config_gpm="yes"],
151 [no], [config_gpm="no"],
152 [AC_MSG_ERROR([bad value '${withval}' for --with-gpm])]
157 AM_CONDITIONAL([CONFIG_GPM], [test "x${config_gpm}" = "xyes"])
159 [test "x${config_gpm}" = "xyes"],
160 [AC_DEFINE([CONFIG_GPM], [1], [Define to 1 to include support for GPM.])]
164 AC_HELP_STRING([--with-mng], [include support for MNG animations]),
166 AS_CASE(["${withval}"],
167 [yes], [config_mng="yes"],
168 [no], [config_mng="no"],
169 [AC_MSG_ERROR([bad value '${withval}' for --with-mng])]
174 AM_CONDITIONAL([CONFIG_MNG], [test "x${config_mng}" = "xyes"])
176 [test "x${config_mng}" = "xyes"],
177 [AC_DEFINE([CONFIG_MNG], [1], [Define to 1 to include support for MNG animations.])]
181 AC_HELP_STRING([--without-png], [exclude support for PNG images]),
183 AS_CASE(["${withval}"],
184 [yes], [config_png="yes"],
185 [no], [config_png="no"],
186 [AC_MSG_ERROR([bad value '${withval}' for --with-png])]
191 AM_CONDITIONAL([CONFIG_PNG], [test "x${config_png}" = "xyes"])
193 [test "x${config_png}" = "xyes"],
194 [AC_DEFINE([CONFIG_PNG], [1], [Define to 1 to include support for PNG images.])]
198 AC_HELP_STRING([--without-ttf], [exclude support for truetype fonts]),
200 AS_CASE(["${withval}"],
201 [yes], [config_ttf="yes"],
202 [no], [config_ttf="no"],
203 [AC_MSG_ERROR([bad value ${withval} for --with-ttf])]
208 AM_CONDITIONAL([CONFIG_TTF], [test "x${config_ttf}" = "xyes"])
210 [test "x${config_ttf}" = "xyes"],
211 [AC_DEFINE([CONFIG_TTF], [1], [Define to 1 to include support for truetype fonts.])]
214 AC_ARG_WITH([ttf-kernel],
215 AC_HELP_STRING([--without-ttf-kernel], [exclude support for truetype fonts in kernel helper]),
217 AS_CASE(["${withval}"],
218 [yes], [config_ttf_kernel="yes"],
219 [no], [config_ttf_kernel="no"],
220 [AC_MSG_ERROR([bad value ${withval} for --with-ttf-kernel])]
223 [config_ttf_kernel="yes"]
225 AM_CONDITIONAL([CONFIG_TTF_KERNEL], [test "x${config_ttf_kernel}" = "xyes"])
227 [test "x${config_ttf_kernel}" = "xyes"],
228 [AC_DEFINE([CONFIG_TTF_KERNEL], [1], [Define to 1 to include support for truetype fonts in kernel helper.])]
231 AC_ARG_WITH([klibc-compiler],
232 AS_HELP_STRING([--with-klibc-compiler], [compiler to use when building against klibc @<:@auto@:>@]),
236 [test "x${host_alias}" != "x${build_alias}"],
237 [AC_CHECK_PROG([KLCC], [${host_alias}-klcc], [${host_alias}-klcc])],
238 [AC_CHECK_PROG([KLCC], [klcc], [klcc])]
241 [test "x${KLCC}" = "x"],
242 [AC_MSG_WARN([could not determine compiler to use when building against klibc.])]
248 AC_ARG_WITH([freetype2-src],
249 AS_HELP_STRING([--with-freetype2-src=DIR], [freetype2 source to use when linking with klibc]),
252 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
253 [LIBFREETYPE2_SOURCE="\$(abs_top_srcdir)/${withval}"],
254 [LIBFREETYPE2_SOURCE="${withval}"]
257 [LIBFREETYPE2_SOURCE="\$(abs_top_srcdir)/\$(LIBFREETYPE2_SOURCE_INTERNAL)"]
259 AC_SUBST([LIBFREETYPE2_SOURCE])
261 AC_ARG_WITH([jpeg-src],
262 AS_HELP_STRING([--with-jpeg-src=DIR], [jpeglib source to use when linking with klibc]),
265 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
266 [LIBJPEG_SOURCE="\$(abs_top_srcdir)/${withval}"],
267 [LIBJPEG_SOURCE="${withval}"]
270 [LIBJPEG_SOURCE="\$(abs_top_srcdir)/\$(LIBJPEG_SOURCE_INTERNAL)"]
272 AC_SUBST([LIBJPEG_SOURCE])
274 AC_ARG_WITH([lpng-src],
275 AS_HELP_STRING([--with-lpng-src=DIR], [libpng source to use when linking with klibc]),
278 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
279 [LIBPNG_SOURCE="\$(abs_top_srcdir)/${withval}"],
280 [LIBPNG_SOURCE="${withval}"]
283 [LIBPNG_SOURCE="\$(abs_top_srcdir)/\$(LIBPNG_SOURCE_INTERNAL)"]
285 AC_SUBST([LIBPNG_SOURCE])
287 AC_ARG_WITH([zlib-src],
288 AS_HELP_STRING([--with-zlib-src=DIR], [zlib source to use when linking with klibc]),
291 [test "`echo ${withval} | sed -e 's,^/.*,,'`" = "${withval}"],
292 [LIBZ_SOURCE="\$(abs_top_srcdir)/${withval}"],
293 [LIBZ_SOURCE="${withval}"]
296 [LIBZ_SOURCE="\$(abs_top_srcdir)/\$(LIBZ_SOURCE_INTERNAL)"]
298 AC_SUBST([LIBZ_SOURCE])
300 AC_ARG_WITH([essential-prefix],
301 AS_HELP_STRING([--with-essential-prefix=ESPREFIX], [install essential files in ESPREFIX @<:@/@:>@]),
302 [essential_prefix="$(echo ${withval} | sed -e 's#/$##')"],
303 [essential_prefix="/"]
305 AC_SUBST([essential_prefix])
307 AC_ARG_WITH([essential-bindir],
308 AS_HELP_STRING([--with-essential-bindir=DIR], [essential user apps directory @<:@ESPREFIX/bin@:>@]),
309 [eexecbindir="${withval}"],
310 [eexecbindir="\$(essential_prefix)/bin"]
312 AC_SUBST([eexecbindir])
314 AC_ARG_WITH([essential-sbindir],
315 AS_HELP_STRING([--with-eseential-sbindir=DIR], [essential admin apps directory @<:@ESPREFIX/sbin@:>@]),
316 [eexecsbindir="${withval}"],
317 [eexecsbindir="\$(essential_prefix)/sbin"]
319 AC_SUBST([eexecsbindir])
321 AC_ARG_WITH([essential-libdir],
322 AS_HELP_STRING([--with-essential-libdir=DIR], [essential libraries directory @<:@ESPREFIX/lib@:>@]),
323 [eexeclibdir="${withval}"],
324 [eexeclibdir="\$(essential_prefix)/lib"]
326 AC_SUBST([eexeclibdir])
328 AC_ARG_WITH([themedir],
329 AS_HELP_STRING([--with-themedir=DIR], [splash theme directory @<:@ESPREFIX/etc/splash@:>@]),
330 [themedir="${withval}"],
331 [themedir="\$(essential_prefix)/etc/splash"]
339 [M_CFLAGS="${M_CFLAGS}"],
340 [AC_MSG_ERROR(['math.h' header file not found.])]
344 [M_LIBS="${M_LIBS} -lm"],
345 [AC_MSG_ERROR(['libm' library not found.])]
354 [RT_CFLAGS="${RT_CFLAGS}"],
355 [AC_MSG_ERROR(['time.h' header file was not found.])]
357 AC_CHECK_LIB([rt], [clock_gettime],
358 [RT_LIBS="${RT_LIBS} -lrt"],
359 [AC_MSG_ERROR(['librt' library was not found.])]
361 AC_SUBST([RT_CFLAGS])
366 AC_CHECK_HEADER([pthread.h],
367 [PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"],
368 [AC_MSG_ERROR(['pthread.h' header file was not found.])]
370 AC_CHECK_LIB([pthread], [pthread_create],
371 [PTHREAD_LIBS="${PTHREAD_LIBS} -lpthread"],
372 [AC_MSG_ERROR(['libpthread' library file was not found.])]
374 AC_SUBST([PTHREAD_CFLAGS])
375 AC_SUBST([PTHREAD_LIBS])
377 PTHREAD_STATIC_CFLFAGS=
381 [PTHREAD_STATIC_CFLFAGS="${PTHREAD_STATIC_CFLFAGS}"],
382 [AC_MSG_ERROR(['pthread.h' header file was not found.])]
384 AC_CHECK_LIB([pthread], [xxpthread_create],
385 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -lpthread"],
387 AC_CHECK_LIB([pthread], [pthread_create],
388 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -L\$(DESTDIR)\$(libdir)/nptl -lpthread"],
390 AC_CHECK_LIB([pthread], [pthread_create],
391 [PTHREAD_STATIC_LIBS="${PTHREAD_STATIC_LIBS} -L\$(DESTDIR)\$(elibdir)/nptl -lpthread"],
392 [AC_MSG_ERROR([the required 'libpthread' static library file not found.])],
393 [-static -L${DESTDIR}${elibdir}/nptl]
396 [-static -L${DESTDIR}${libdir}/nptl]
401 AC_SUBST([PTHREAD_STATIC_CFLAGS])
402 AC_SUBST([PTHREAD_STATIC_LIBS])
404 AC_ARG_VAR([JPEG_CFLAGS], [C compiler flags for JPEG library, overriding autodetection])
405 AC_ARG_VAR([JPEG_LIBS], [linker flags for JPEG library, overriding autodetection])
407 [test "x${JPEG_CFLAGS}" = "x"],
409 AC_CHECK_HEADER([jpeglib.h],
410 [JPEG_CFLAGS="${JPEG_CFLAGS}"],
411 [AC_MSG_ERROR(['jpeglib.h' header file not found.])]
416 [test "x${JPEG_CFLAGS}" = "no"],
420 [test "x${JPEG_LIBS}" = "x"],
422 AC_CHECK_LIB([jpeg], [jpeg_set_defaults],
423 [JPEG_LIBS="${JPEG_LIBS} -ljpeg"],
424 [AC_MSG_ERROR([the required 'libjpeg' library file was not found.])]
429 [test "x${JPEG_LIBS}" = "no"],
432 AC_SUBST([JPEG_CFLAGS])
433 AC_SUBST([JPEG_LIBS])
435 # As needed, check GPM files and set GPM compiler flags.
436 AC_ARG_VAR([GPM_CFLAGS], [C compiler flags for GPM library, overriding autodetection])
437 AC_ARG_VAR([GPM_LIBS], [linker flags for GPM library, overriding autodetection])
439 [test "x${config_gpm}" = "xyes"],
442 [test "x${GPM_CFLAGS}" = "x"],
446 [GPM_CFLAGS="${GPM_CFLAGS}"],
447 [AC_MSG_ERROR(['gpm.h' header file was not found.])]
452 [test "x${GPM_CFLAGS}" = "no"],
456 [test "x${GPM_LIBS}" = "x"],
460 [GPM_LIBS="${GPM_LIBS} -lgpm"],
461 [AC_MSG_ERROR(['libgpm' library file was not found.])]
466 [test "x${GPM_LIBS}" = "no"],
471 AC_SUBST([GPM_CFLAGS])
474 AC_ARG_VAR([MNG_CFLAGS], [C compiler flags for MNG library, overriding autodetection])
475 AC_ARG_VAR([MNG_LIBS], [linker flags for MNG library, overriding autodetection])
477 [test "x${config_mng}" = "xyes"],
480 [test "x${MNG_CFLAGS}" = "x"],
485 MNG_CFLAGS="${MNG_CFLAGS}"
486 MNG_CFLAGS="${MNG_CFLAGS} ${JPEG_CFLAGS}"
487 MNG_CFLAGS="${MNG_CFLAGS} ${RT_CFLAGS}"
489 [AC_MSG_ERROR(['libmng.h' header file was not found.])]
494 [test "x${MNG_CFLAGS}" = "xno"],
498 [test "x${MNG_LIBS}" = "x"],
501 [mng], [mng_initialize],
503 MNG_LIBS="${MNG_LIBS} -lmng"
504 MNG_LIBS="${MNG_LIBS} ${JPEG_LIBS}"
505 MNG_LIBS="${MNG_LIBS} ${LT_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])