143 lines
3.7 KiB
Plaintext
143 lines
3.7 KiB
Plaintext
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
# 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(eet, 0.9.10.013)
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
AC_PROG_CC
|
|
AM_PROG_CC_STDC
|
|
AC_HEADER_STDC
|
|
AC_C_CONST
|
|
AM_ENABLE_SHARED
|
|
AM_PROG_LIBTOOL
|
|
|
|
AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
|
|
AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
|
|
|
|
AC_CHECK_HEADERS(netinet/in.h)
|
|
|
|
case "$host_os" in
|
|
mingw|mingw32)
|
|
winsock_libs="-lwsock32"
|
|
;;
|
|
esac
|
|
|
|
AC_SUBST(winsock_libs)
|
|
|
|
AC_CHECK_HEADER(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file]))
|
|
|
|
AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
|
|
if test "x$res" = "xno"; then
|
|
AC_CHECK_LIB(fnmatch, fnmatch, res=yes, res=no)
|
|
if test "x$res" = "xno"; then
|
|
AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch])
|
|
else
|
|
fnmatch_libs="-lfnmatch"
|
|
fi
|
|
fi
|
|
|
|
AC_SUBST(fnmatch_libs)
|
|
|
|
dnl These are needed for fmemopen/open_memstream
|
|
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
|
|
AC_DEFINE(__USE_GNU, , [Enable GNU extensions])
|
|
|
|
AC_CHECK_FUNCS(fmemopen open_memstream realpath)
|
|
|
|
dnl Check whether the null pointer is zero on this arch
|
|
AC_MSG_CHECKING([value of the null pointer])
|
|
AC_TRY_RUN([
|
|
#include <stdlib.h>
|
|
int main () {
|
|
void *foo = NULL;
|
|
int bar = (int) foo;
|
|
|
|
return (int) foo;}
|
|
], AC_MSG_RESULT([\o/]), [
|
|
AC_MSG_RESULT([o_O])
|
|
AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
|
|
], AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
|
|
)
|
|
|
|
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
|
|
if test "x${prefix}" = "xNONE"; then
|
|
bindir="${ac_default_prefix}/bin";
|
|
else
|
|
bindir="${prefix}/bin";
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
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
|
|
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_SOURCE_DIR in config.h.
|
|
packagesrcdir=`cd $srcdir && pwd`
|
|
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Source code directory])
|
|
|
|
AC_OUTPUT([
|
|
Makefile
|
|
eet.pc
|
|
src/Makefile
|
|
src/lib/Makefile
|
|
src/bin/Makefile
|
|
eet-config
|
|
README
|
|
eet.spec
|
|
eet.oe
|
|
eet-native.oe
|
|
eet.bb
|
|
eetXnative.bb
|
|
debian/changelog
|
|
],[
|
|
chmod +x eet-config
|
|
])
|