AC_PREREQ(2.50)
AC_INIT([codeblocks], [1.0-RC2])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([codeblocks], 1.0-RC2)
AC_CONFIG_HEADER([src/sdk/config.h])
dnl Checks for programs.
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_AWK
CODEBLOCKS_SETUP_FOR_TARGET
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h sys/param.h unistd.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_C_VOLATILE
dnl Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([atexit getcwd isascii memchr memmove memset strcasecmp strchr strcspn strdup strrchr strstr])
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF,,snprintf))
AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF,,vsnprintf))
dnl versioning info for libtool
dnl Note this is the ABI version which is not the same as our actual library version
CODEBLOCKS_CURRENT=0
CODEBLOCKS_REVISION=1
CODEBLOCKS_AGE=0
CODEBLOCKS_VERSION_INFO=$CODEBLOCKS_CURRENT:$CODEBLOCKS_REVISION:$CODEBLOCKS_AGE
AC_SUBST(CODEBLOCKS_VERSION_INFO)
CODEBLOCKS_GET_PLATFORM
CODEBLOCKS_ENABLE_SETTINGS
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG(2.4.2, wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
wxWidgets must be installed on your system.
Please check that wx-config is in path, the directory
where wxWidgets libraries are installed (returned by
'wx-config --libs' or 'wx-config --static --libs' command)
is in LD_LIBRARY_PATH or equivalent variable and
wxWindows version is 2.4.2 or above.
])
fi
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LIBS="$LIBS $WX_LIBS"
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
if test "$wx_config_minor_version" -gt "4"; then
WX_XRC=
else
WX_XRC=-l`wx-config --basename`_xrc-`wx-config --release`
fi
AC_SUBST(WX_XRC)
AC_SUBST(CPPFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
dnl AM_PATH_GTK(1.2.7, ,
dnl AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?),
dnl gthread)
AM_CONDITIONAL([LINUX], [test `uname` = "Linux"])
AC_MSG_NOTICE([Configuring Code::Blocks...])
AC_CONFIG_FILES([Makefile
src/Makefile
src/sdk/Makefile
src/sdk/tinyxml/Makefile
src/sdk/wxscintilla/Makefile
src/sdk/resources/Makefile
src/sdk/resources/lexers/Makefile
src/src/wxDockit/Makefile
src/src/resources/Makefile
src/src/resources/icons/Makefile
src/src/resources/images/Makefile
src/src/resources/images/16x16/Makefile
src/src/Makefile
src/plugins/Makefile
src/plugins/astyle/Makefile
src/plugins/astyle/resources/Makefile
src/plugins/classwizard/Makefile
src/plugins/classwizard/resources/Makefile
src/plugins/codecompletion/Makefile
src/plugins/codecompletion/resources/Makefile
src/plugins/compilergcc/Makefile
src/plugins/compilergcc/depslib/Makefile
src/plugins/compilergcc/depslib/src/Makefile
src/plugins/compilergcc/resources/Makefile
src/plugins/debuggergdb/Makefile
src/plugins/debuggergdb/resources/Makefile
src/plugins/defaultmimehandler/Makefile
src/plugins/defaultmimehandler/resources/Makefile
src/plugins/pluginwizard/Makefile
src/plugins/pluginwizard/resources/Makefile
src/plugins/todo/Makefile
src/plugins/todo/resources/Makefile
src/plugins/xpmanifest/Makefile
src/plugins/contrib/Makefile
src/plugins/contrib/codestat/Makefile
src/plugins/contrib/codestat/resources/Makefile
src/plugins/contrib/profiler/Makefile
src/plugins/contrib/profiler/resources/Makefile
src/tools/Makefile
src/tools/ConsoleRunner/Makefile
src/setup/Makefile
src/setup/mime/Makefile
src/templates/Makefile
src/templates/common/Makefile
src/templates/unix/Makefile
src/templates/win32/Makefile
codeblocks.pc
])
AC_OUTPUT
echo
echo
echo "*************************************************"
echo "* Code::Blocks source tree has been configured. *"
echo "*************************************************"
echo
echo "You can now build Code::Blocks by issuing 'make'".
echo "When the build is complete, become root and install"
echo "it by issuing 'make install'".
echo