# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT([TilEm], [0.971], [benjamin@ecg.mit.edu]) AC_CONFIG_SRCDIR([src/tilem/main.c]) AC_CONFIG_HEADER([config.h]) # mkdir test by Alexandre Duret-Lutz AC_DEFUN([AC_FUNC_MKDIR], [AC_CHECK_FUNCS([mkdir _mkdir]) AC_CACHE_CHECK([whether mkdir takes one argument], [ac_cv_mkdir_takes_one_arg], [AC_TRY_COMPILE([ #include #if HAVE_UNISTD_H # include #endif ], [mkdir (".");], [ac_cv_mkdir_takes_one_arg=yes], [ac_cv_mkdir_takes_one_arg=no])]) if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1, [Define if mkdir takes only one argument.]) fi ]) # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_UID_T AC_C_VOLATILE # Checks host system characteristics AC_CANONICAL_HOST case $host_cpu in i?86*) AC_DEFINE(X86_ASM) ;; esac AC_CHECK_SIZEOF([long]) case $SIZEOF_LONG in 8) AC_DEFINE(__64BIT__) ;; 16) AC_DEFINE(__128BIT__) ;; esac AC_C_BIGENDIAN(,[AC_DEFINE(LSB_FIRST)]) # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_REALLOC AC_TYPE_SIGNAL AC_CHECK_FUNCS([memmove memset strcasecmp strchr strrchr strdup strncasecmp strstr strtol tzset]) AC_CHECK_FUNC([usleep],[AC_DEFINE([HAVE_USLEEP])],[]) AC_FUNC_MKDIR # Checks for libraries. AC_ARG_WITH(ticables, AC_HELP_STRING([--with-ticables], [use the ticables2 library for external linking [[yes]]]), [use_ticables=$withval], [use_ticables=yes]) if test "$use_ticables" = yes; then if test "x$TICABLES_CFLAGS" = "x" && test "x$TICABLES_LIBS" = "x"; then PKG_CHECK_MODULES(TICABLES, ticables2 >= 0.0.3, [AC_DEFINE(extlink)], [AC_MSG_NOTICE([[ticables2 not found; external linking will be disabled]])]) else AC_DEFINE(extlink) fi AC_SUBST(TICABLES_CFLAGS) AC_SUBST(TICABLES_LIBS) fi PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0) PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0) PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.0.0) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) AC_SUBST(GTHREAD_CFLAGS) AC_SUBST(GTHREAD_LIBS) AC_SUBST(IMLIB_CFLAGS) AC_SUBST(IMLIB_LIBS) AC_CONFIG_FILES([Makefile src/Makefile src/tilem/Makefile src/utils/Makefile]) AC_OUTPUT