legacy-imlib2/configure.in

588 lines
14 KiB
Plaintext
Raw Normal View History

# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(configure.in)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX
AM_INIT_AUTOMAKE(imlib2, 1.2.1.004)
AM_CONFIG_HEADER(config.h)
AC_C_BIGENDIAN
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
dnl Next four lines is a hack to prevent libtool checking for CXX/F77
m4_undefine([AC_PROG_CXX])
m4_defun([AC_PROG_CXX],[])
m4_undefine([AC_PROG_F77])
m4_defun([AC_PROG_F77],[])
AM_PROG_LIBTOOL
2005-01-03 19:52:32 -08:00
if test "x${bindir}" = 'x${exec_prefix}/bin'; then
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
else
2005-01-03 19:52:32 -08:00
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
fi
fi
2005-01-03 19:52:32 -08:00
if test "x${libdir}" = 'x${exec_prefix}/lib'; then
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
else
2005-01-03 19:52:32 -08:00
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
fi
fi
dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin", [Installation directory for user executables])
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", [Installation directory for user executables])
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", [Installation directory for user executables])
fi
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib", [Installation directory for libraries])
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", [Installation directory for libraries])
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", [Installation directory for libraries])
fi
dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", "Package installed data destination")
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", "Package installed data destination")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", "Package installed data destination")
fi
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Source code directory])
# FIXME: fill in requirements for pc.in - but only ft2 has a pc file!
requirements="freetype2"
mmx=no
2005-04-08 17:08:58 -07:00
amd64=no
case $host_cpu in
i*86)
mmx="yes"
;;
2005-04-08 17:08:58 -07:00
x86_64)
amd64="yes"
;;
esac
2005-04-08 17:08:58 -07:00
AC_ARG_ENABLE(mmx,[ --enable-mmx attempt compiling using mmx assembly [default=auto]],
[
if test x$enableval = xyes; then
mmx=yes
# Cannot compile with both options enabled
amd64=no
else
mmx=no
fi
]
)
2005-04-08 17:08:58 -07:00
AC_ARG_ENABLE(amd64,[ --enable-amd64 attempt compiling using amd64 assembly [default=auto]],
2005-04-08 17:08:58 -07:00
[
if test x$enableval = xyes; then
amd64=yes
mmx=no
else
amd64=no
fi
]
)
AC_MSG_CHECKING(whether to enable x86 mmx support)
if test x$mmx = xyes; then
AC_DEFINE(DO_MMX_ASM, 1, [enabling MMX Assembly])
fi
AC_MSG_RESULT($mmx)
AM_CONDITIONAL(BUILD_MMX, test x$mmx = xyes)
AC_MSG_CHECKING(whether to enable amd64 asm support)
2005-04-08 17:08:58 -07:00
if test x$amd64 = xyes; then
AC_DEFINE(DO_AMD64_ASM, 1, [enabling AMD64 Assembly])
fi
AC_MSG_RESULT($amd64)
2005-04-08 17:08:58 -07:00
AM_CONDITIONAL(BUILD_AMD64, test x$amd64 = xyes)
# check for freetype
AC_ARG_WITH(freetype-config, [ --with-freetype-config=FREETYPE_CONFIG use freetype-config specified ],
[ FREETYPE_CONFIG=$withval;
echo "using "$FREETYPE_CONFIG" for freetype-config"; ],
2004-11-11 18:24:00 -08:00
[ if test -z "$FREETYPE_CONFIG"; then
AC_PATH_PROG(FREETYPE_CONFIG, "freetype-config", "", $PATH)
fi
])
2004-11-11 18:24:00 -08:00
freetype_cflags=`$FREETYPE_CONFIG --cflags`
freetype_libs=`$FREETYPE_CONFIG --libs`
AC_PATH_X([X11], [X11/Xlib.h], [XOpenDisplay(NULL)])
if test "x$have_x" = "xno"; then
# If --without-x was passed, this will be "disabled" instead of "no" --
# so always treat "no" as an error
AC_MSG_ERROR(
[no X support found. Use --x-includes and --x-libraries to specify the X
path on your system, or --without-x to disable X support.])
fi
if test "x$have_x" = "xyes"; then
if test "x$x_includes" != "x"; then
x_cflags="-I$x_includes"
fi
if test "x$x_libraries" != "x"; then
x_libs="-L$x_libraries -lX11 -lXext"
else
x_libs="-lX11 -lXext"
fi
AM_CONDITIONAL(BUILD_X11, true)
AC_DEFINE(BUILD_X11, 1, [enabling X11 support])
else
x_cflags=""
x_libs=""
AM_CONDITIONAL(BUILD_X11, false)
fi
dlopen_libs=""
AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
my_includes=$freetype_cflags" "$x_cflags" "
my_libs=$freetype_libs" "$x_libs" "$dlopen_libs" -lm"
AC_SUBST(my_includes)
AC_SUBST(my_libs)
AC_MSG_CHECKING(whether to enable jpeg support)
AC_ARG_WITH(jpeg,
[AC_HELP_STRING([--without-jpeg],[Disable JPEG image loader])],
[
if test "$withval" = no ; then
jpeg_loader=no
else
jpeg_loader=yes
fi
],[ jpeg_loader=auto ]
)
AC_MSG_RESULT($jpeg_loader)
if test "$jpeg_loader" != no ; then
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
jpeg_ok=yes,
jpeg_ok=no
AC_MSG_WARN(*** Native JPEG support will not be built (JPEG library not found) ***),
)
if test "$jpeg_ok" = yes; then
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <jpeglib.h>],
jpeg_ok=yes,
jpeg_ok=no)
AC_MSG_RESULT($jpeg_ok)
if test "$jpeg_ok" = yes; then
JPEGLIBS="-ljpeg"
else
AC_MSG_WARN(*** Native JPEG support will not be built (JPEG header file not found) ***)
fi
fi
if test "$jpeg_loader" = yes -a "$jpeg_ok" = no; then
AC_MSG_ERROR(JPEG support was requested but system does not support it)
fi
else
jpeg_ok=no
fi
AM_CONDITIONAL(BUILD_JPEG_LOADER, test "$jpeg_ok" = yes)
AC_SUBST(JPEGLIBS)
AC_MSG_CHECKING(whether to enable png support)
AC_ARG_WITH(png,
[AC_HELP_STRING([--without-png],[Disable PNG image loader])],
[
if test "$withval" = no ; then
png_loader=no
else
png_loader=yes
fi
],[ png_loader=auto ]
)
AC_MSG_RESULT($png_loader)
if test "$png_loader" != no ; then
AC_CHECK_LIB(png, png_read_info,
png_ok=yes,
png_ok=no
AC_MSG_WARN(*** Native PNG support will not be built (PNG library not found) ***),
-lz -lm)
if test "$png_ok" = yes; then
AC_MSG_CHECKING([for png.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <png.h>],
png_ok=yes,
png_ok=no)
AC_MSG_RESULT($png_ok)
if test "$png_ok" = yes; then
PNGLIBS="-lpng -lz -lm"
else
AC_MSG_WARN(*** Native PNG support will not be built (PNG header file not found) ***)
fi
fi
if test "$png_loader" = yes -a "$png_ok" = no; then
AC_MSG_ERROR(PNG support was requested but system does not support it)
fi
else
png_ok=no
fi
AM_CONDITIONAL(BUILD_PNG_LOADER, test "$png_ok" = yes)
AC_SUBST(PNGLIBS)
AC_MSG_CHECKING(whether to enable tiff support)
AC_ARG_WITH(tiff,
[AC_HELP_STRING([--without-tiff],[Disable TIFF image loader])],
[
if test "$withval" = no ; then
tiff_loader=no
else
tiff_loader=yes
fi
],[ tiff_loader=auto ]
)
AC_MSG_RESULT($tiff_loader)
if test "$tiff_loader" != no ; then
AC_CHECK_LIB(tiff, TIFFReadScanline,
tiff_libs="-ltiff"
tiff_ok=yes,
AC_CHECK_LIB(tiff, TIFFReadScanline,
tiff_libs="-ltiff -ljpeg -lz -lm"
tiff_ok=yes,
AC_CHECK_LIB(tiff34, TIFFReadScanline,
tiff_libs="-ltiff34 -ljpeg -lz -lm"
tiff_ok=yes,
tiff_ok=no
AC_MSG_WARN(*** Native TIFF support will not be built (TIFF library not found) ***),
-ljpeg -lz -lm),
-ljpeg -lz -lm),
)
if test "$tiff_ok" = yes; then
AC_MSG_CHECKING([for tiffio.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <tiffio.h>],
tiff_ok=yes,
tiff_ok=no)
AC_MSG_RESULT($tiff_ok)
if test "$tiff_ok" = yes; then
TIFFLIBS=$tiff_libs
else
AC_MSG_WARN(*** Native TIFF support will not be built (TIFF header file not found) ***)
fi
fi
if test "$tiff_loader" = yes -a "$tiff_ok" = no; then
AC_MSG_ERROR(TIFF support was requested but system does not support it)
fi
else
tiff_ok=no
fi
AM_CONDITIONAL(BUILD_TIFF_LOADER, test "$tiff_ok" = yes)
AC_SUBST(TIFFLIBS)
AC_CHECK_LIB(ungif, DGifOpenFileName,
gif_libs="-lungif"
gif_ok=yes,
gif_ok=no,
)
if test "$gif_ok" = yes; then
AC_MSG_CHECKING([for gif_lib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <gif_lib.h>],
gif_ok=yes,
gif_ok=no)
AC_MSG_RESULT($gif_ok)
if test "$gif_ok" = yes; then
GIFLIBS=$gif_libs
fi
fi
if test "$gif_ok" = no; then
AC_CHECK_LIB(gif, DGifOpenFileName,
gif_libs="-lgif"
gif_ok=yes,
gif_ok=no
AC_MSG_WARN(*** Native GIF support will not be built (GIF library not found) ***),
)
if test "$gif_ok" = yes; then
AC_MSG_CHECKING([for gif_lib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <gif_lib.h>],
gif_ok=yes,
gif_ok=no)
AC_MSG_RESULT($gif_ok)
if test "$gif_ok" = yes; then
GIFLIBS=$gif_libs
else
AC_MSG_WARN(*** Native GIF support will not be built (GIF header file not found) ***)
fi
fi
fi
AM_CONDITIONAL(BUILD_GIF_LOADER, test "$gif_ok" = yes)
AC_SUBST(GIFLIBS)
AC_MSG_CHECKING(whether to enable zlib support)
AC_ARG_WITH(zlib,
[AC_HELP_STRING([--without-zlib],[Disable ZLIB loader])],
[
if test "$withval" = no ; then
zlib_loader=no
else
zlib_loader=yes
fi
],[ zlib_loader=auto ]
)
AC_MSG_RESULT($zlib_loader)
if test "$zlib_loader" != no ; then
AC_CHECK_LIB(z, uncompress,
zlib_ok=yes,
zlib_ok=no
AC_MSG_WARN(*** Native zlib support will not be built (zlib not found) ***),
)
if test "$zlib_ok" = yes; then
AC_MSG_CHECKING([for zlib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <zlib.h>],
zlib_ok=yes,
zlib_ok=no)
AC_MSG_RESULT($zlib_ok)
if test "$zlib_ok" = yes; then
ZLIBLIBS="-lz"
else
AC_MSG_WARN(*** Native zlib support will not be built (zlib header file not found) ***)
fi
fi
if test "$zlib_loader" = yes -a "$zlib_ok" = no; then
AC_MSG_ERROR(ZLIB support was requested but system does not support it)
fi
else
zlib_ok=no
fi
AM_CONDITIONAL(BUILD_ZLIB_LOADER, test "$zlib_ok" = yes)
AC_SUBST(ZLIBLIBS)
AC_MSG_CHECKING(whether to enable bzip2 support)
AC_ARG_WITH(bzip2,
[AC_HELP_STRING([--without-bzip2],[Disable BZIP2 loader])],
[
if test "$withval" = no ; then
bz2_loader=no
else
bz2_loader=yes
fi
],[ bz2_loader=auto ]
)
AC_MSG_RESULT($bz2_loader)
if test "$bz2_loader" != no ; then
AC_CHECK_LIB(bz2, BZ2_bzRead,
bz2_ok=yes,
bz2_ok=no
AC_MSG_WARN(*** Native bz2 support will not be built (bzip2 library not found) ***),
)
if test "$bz2_ok" = yes; then
AC_MSG_CHECKING([for bzlib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <bzlib.h>],
bz2_ok=yes,
bz2_ok=no)
AC_MSG_RESULT($bz2_ok)
if test "$bz2_ok" = yes; then
BZ2LIBS="-lbz2"
else
AC_MSG_WARN(*** Native bz2 support will not be built (bzip2 header file not found) ***)
fi
fi
if test "$bz2_loader" = yes -a "$bz2_ok" = no; then
AC_MSG_ERROR(BZIP2 support was requested but system does not support it)
fi
else
bz2_ok=no
fi
AM_CONDITIONAL(BUILD_BZ2_LOADER, test "$bz2_ok" = yes)
AC_SUBST(BZ2LIBS)
AC_MSG_CHECKING(whether to enable id3 support)
AC_ARG_WITH(id3,
[AC_HELP_STRING([--without-id3],[Disable ID3 loader])],
[
if test "$withval" = no ; then
id3_loader=no
else
id3_loader=yes
fi
],[ id3_loader=auto ]
)
AC_MSG_RESULT($id3_loader)
if test "$id3_loader" != no ; then
AC_CHECK_LIB(id3tag, id3_file_open,
id3_libs="-lz -lid3tag"
id3_ok=yes,
id3_ok=no
AC_MSG_WARN(*** Native mp3 support will not be built (id3tag library not found) ***),
-lz)
if test "$id3_ok" = yes; then
AC_MSG_CHECKING([for id3tag.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <id3tag.h>],
id3_ok=yes,
id3_ok=no)
AC_MSG_RESULT($id3_ok)
if test "$id3_ok" = yes; then
ID3LIBS=$id3_libs
else
AC_MSG_WARN(*** Native id3 mp3 tag support will not be built (id3tag header file not found) ***)
fi
fi
if test "$id3_loader" = yes -a "$id3_ok" = no; then
AC_MSG_ERROR(ID3 support was requested but system does not support it)
fi
else
id3_ok=no
fi
AM_CONDITIONAL(BUILD_ID3_LOADER, test "$id3_ok" = yes)
AC_SUBST(ID3LIBS)
AC_SUBST(requirements)
AC_OUTPUT([
Makefile
imlib2.pc
src/Makefile
src/lib/Makefile
src/bin/Makefile
src/modules/Makefile
src/modules/filters/Makefile
src/modules/loaders/Makefile
data/Makefile
data/fonts/Makefile
data/images/Makefile
doc/Makefile
imlib2-config
README
imlib2.spec
imlib2.oe
imlib2-native.oe
imlib2.bb
imlib2Xnative.bb
debian/changelog
],[
chmod +x imlib2-config
])
#####################################################################
## Info
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
echo
echo "Image Loaders:"
echo " JPEG....................: $jpeg_ok"
echo " PNG.....................: $png_ok"
echo " TIFF....................: $tiff_ok"
echo " GIF.....................: $gif_ok"
echo " ZLIB....................: $zlib_ok"
echo " BZIP2...................: $bz2_ok"
echo " ID3.....................: $id3_ok"
echo
echo
2005-01-19 04:28:53 -08:00
echo "Use MMX for extra speed...: $mmx"
2005-04-08 17:08:58 -07:00
echo "Use AMD64 for extra speed.: $amd64"
2005-01-19 04:28:53 -08:00
echo
echo
echo "Installation Path.........: $prefix"
echo
echo "Compilation...............: make"
echo "Installation..............: make install"
echo