legacy-imlib2/configure.in

436 lines
11 KiB
Plaintext

# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(configure.in)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_ISC_POSIX
AM_INIT_AUTOMAKE(imlib2, 1.1.1)
AM_CONFIG_HEADER(config.h)
AC_C_BIGENDIAN
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
else
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
fi
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
else
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
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
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_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Source code directory])
dnl here was freetype stuff (1)
# check for freetype
AC_ARG_WITH(freetype-config,
[ --with-freetype-config=FREETYPE_CONFIG use freetype-config specified ],
[
PROG_CONFIG=$withval;
echo "using "$PROG_CONFIG" for freetype-config";
],[
PROG="freetype-config";
AC_PATH_PROG(PROG_CONFIG, $PROG, "", $PATH)
])
if [ test -z $PROG_CONFIG ]; then
echo $PROG " is not in your \$PATH. Please ensure it is.";
echo "You may need to install the library and/or development packages";
echo "that contain this configure-script.";
echo "FATAL ERROR. ABORT.";
exit -1;
fi
freetype_cflags=`$PROG_CONFIG --cflags`
freetype_libs=`$PROG_CONFIG --libs`
dnl /here was freetype stuff (1)
mmx=no
AC_ARG_ENABLE(mmx,[ --enable-mmx attempt compiling using mmx assembly [default=yes]],
[
if test x$enableval = xyes; then
mmx=yes
fi
],
[
if test x$target_os = xlinux-gnu; then
mmx=`cat /proc/cpuinfo | grep mmx`
if test -n "$mmx"; then
mmx=yes
fi
else
echo ""
echo "You are not running Linux - This script cannot auto-detect mmx assembly."
echo "You will have to enable the mmx assembly (which gives anywhere from 10%"
echo "to 300% speedups) by adding --enable-mmx on the configure command-line."
echo ""
fi
]
)
if test x$mmx = xyes; then
AC_DEFINE(DO_MMX_ASM, 1, [enabling MMX Assembly])
fi
AM_CONDITIONAL(HAVE_MMX, test x$mmx = xyes)
pkglibdir='${libdir}'/imlib2_loaders
AC_SUBST(pkglibdir)
#if test X"$enable_shared" = Xyes; then
# DLLDFLAGS=-export-dynamic
# AC_SUBST(DLLDFLAGS)
#fi
dnl AM_PROG_AS
ASFLAGS="$ASFLAGS -I../"
AS=$CC
AC_SUBST(ASFLAGS)
AC_SUBST(AS)
CCASFLAGS="$ASFLAGS"
CCAS="$AS"
AC_SUBST(CCASFLAGS)
AC_SUBST(CCAS)
AC_MSG_CHECKING(whether fopen accepts "b" mode)
AC_CACHE_VAL([ag_cv_func_fopen_binary],
[AC_TRY_RUN([#include <stdio.h>
int main (int argc, char *argv[])
{
FILE *fp = fopen("/bin/sh", "rb");
return (fclose(fp) >= 0);
}],[ag_cv_func_fopen_binary=yes],
[ag_cv_func_fopen_binary=yes],[ag_cv_func_fopen_binary=yes])
rm -f core *.exe.core])
AC_MSG_RESULT([$ag_cv_func_fopen_binary])
if test x$ag_cv_func_fopen_binary = xyes; then
AC_DEFINE(USE_FOPEN_BINARY, 1,
[Define this if we can use the "b" mode for fopen safely.])
fi
AC_PATH_X
AC_PATH_XTRA
if test "x$have_x" = "xdisabled"; then
AC_MSG_WARN([Xlib support is disabled.])
AM_CONDITIONAL(HAVE_X, false)
XMISS="-DX_DISPLAY_MISSING"
else
AM_CONDITIONAL(HAVE_X, true)
XMISS=""
if test "x$x_includes" = "x"; then
x_includes="/usr/include"
fi
x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS"
x_libs="$X_LIBS $X_EXTRA_LIBS"
X_OBJS="color.lo context.lo draw.lo grab.lo rend.lo rgba.lo ximage.lo"
AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $x_libs",
AC_MSG_ERROR([ERROR: libX11 not found.]); exit,
$X_LDFLAGS $X_EXTRA_LIBS $X_LIBS)
AC_CHECK_LIB(Xext, XShmAttach, x_libs="-lXext $x_libs",
AC_CHECK_LIB(XextSam, XShmAttach,
x_libs="-lXextSam -lXext $x_libs",
AC_MSG_ERROR([ERROR: XShm not found.]); exit,
$x_libs),
$x_libs)
AC_CHECK_LIB(Xext, XShapeCombineMask, x_libs="-lXext $x_libs",
AC_MSG_ERROR([ERROR: XShape not found.]); exit,
$x_libs)
fi
AC_SUBST(XMISS)
AC_SUBST(XDIR)
AC_SUBST(X_OBJS)
# This is necessary so that .o files in LIBOBJS are also built via
# the ANSI2KNR-filtering rules.
dnl# Doesn't work with autoconf-2.13!
dnl# LIB@&t@OBJS=`echo "$LIB@&t@OBJS" |
dnl# sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
LTLIBOBJS=`echo "$LIB@&t@OBJS" |
sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
AC_SUBST(LTLIBOBJS)
dnl here was freetype headers checking
dnl /here was freetype headers checking
AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
AC_CHECK_LIB(ltdl, lt_dlopen, ltdlopen_libs=-lltdl)
EXTRA_LIBS="-L/usr/local/lib -L/usr/X11R6/lib"
# Test for libjpeg
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) ***), $EXTRA_LIBS)
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
# Test for libpng
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) ***), $EXTRA_LIBS -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"
REQUIREMENTS=libpng12
else
AC_MSG_WARN(*** Native PNG support will not be built (PNG header file not found) ***)
fi
fi
# Test for libtiff
AC_CHECK_LIB(tiff, TIFFReadScanline,
tiff_libs="-ltiff"
tiff_ok=yes,
AC_CHECK_LIB(tiff, TIFFWriteScanline,
tiff_libs="-ltiff -ljpeg -lz -lm"
tiff_ok=yes,
AC_CHECK_LIB(tiff34, TIFFFlushData,
tiff_libs="-ltiff -ljpeg -lz -lm"
tiff_ok=yes,
tiff_ok=no
AC_MSG_WARN(*** Native TIFF support will not be built (TIFF library not found) ***),
$EXTRA_LIBS -ljpeg -lz -lm),
$EXTRA_LIBS -ljpeg -lz -lm),
$EXTRA_LIBS)
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
# Test for libungif
AC_CHECK_LIB(ungif, DGifOpenFileName,
gif_libs="-lungif"
gif_ok=yes,
gif_ok=no,
$EXTRA_LIBS -lX11)
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
# Test for libgif
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) ***),
$EXTRA_LIBS)
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
# Test for zlib
AC_CHECK_LIB(z, uncompress,
zlib_ok=yes,
zlib_ok=no
AC_MSG_WARN(*** Native zlib support will not be built (zlib not found) ***), $EXTRA_LIBS -lz)
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
# Test for libbzip2
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) ***), $EXTRA_LIBS -lbz2)
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
AM_CONDITIONAL(JPEG_LOADER, test "$jpeg_ok" = yes)
AM_CONDITIONAL(PNG_LOADER, test "$png_ok" = yes)
AM_CONDITIONAL(TIFF_LOADER, test "$tiff_ok" = yes)
AM_CONDITIONAL(GIF_LOADER, test "$gif_ok" = yes)
AM_CONDITIONAL(ZLIB_LOADER, test "$zlib_ok" = yes)
AM_CONDITIONAL(BZ2_LOADER, test "$bz2_ok" = yes)
AC_SUBST(JPEGLIBS)
AC_SUBST(PNGLIBS)
AC_SUBST(TIFFLIBS)
AC_SUBST(GIFLIBS)
AC_SUBST(ZLIBLIBS)
AC_SUBST(BZ2LIBS)
AC_SUBST(REQUIREMENTS)
AC_SUBST(x_cflags)
AC_SUBST(x_includes)
AC_SUBST(x_ldflags)
AC_SUBST(x_libs)
AC_SUBST(dlopen_libs)
AC_SUBST(ltdlopen_libs)
AC_SUBST(freetype_cflags)
AC_SUBST(freetype_libs)
dnl AC_SUBST(freetype_libs)
dnl AC_SUBST(freetype_includes)
dnl# This stuff is not compatible with autoconf-2.13
dnl# AC_CONFIG_FILES([imlib2-config imlib2.pc Makefile loaders/Makefile src/Makefile test/Makefile \
dnl# filters/Makefile demo/Makefile doc/Makefile libltdl/Makefile \
dnl# ])
dnl# AC_CONFIG_COMMANDS([default],[[
dnl# chmod +x imlib2-config
dnl# ]],[[]])
dnl# AC_OUTPUT
AC_OUTPUT([
Makefile
loaders/Makefile
src/Makefile
test/Makefile
filters/Makefile
demo/Makefile
doc/Makefile
imlib2-config
imlib2.pc
],[
chmod +x imlib2-config
])