Sorting out configure stuff
This commit is contained in:
parent
f1cdacd3f4
commit
79be039ae9
@ -1,6 +1,6 @@
|
||||
EXTRA_DIST = makewin mingw-configure
|
||||
|
||||
DIST_SUBDIRS = moo tests
|
||||
DIST_SUBDIRS = moo tests m4
|
||||
SUBDIRS = moo
|
||||
|
||||
if !MOO_OS_CYGWIN
|
||||
@ -9,3 +9,5 @@ endif
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = moo.pc
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
591
acinclude.m4
591
acinclude.m4
@ -1,591 +0,0 @@
|
||||
##############################################################################
|
||||
# _AC_CHECK_PYTHON_MINGW(version,action-if-found,action-if-not-found)
|
||||
# checks python stuff when building for mingw. it's broken
|
||||
#
|
||||
AC_DEFUN([_AC_CHECK_PYTHON_MINGW],[
|
||||
no_dot_version=`echo $1 | sed "s/\.//"`
|
||||
|
||||
if test -z $PYTHON_PARENT_DIR; then
|
||||
PYTHON_PARENT_DIR=/usr/local/win
|
||||
fi
|
||||
if test -z $PYTHON_PREFIX; then
|
||||
PYTHON_PREFIX=$PYTHON_PARENT_DIR/Python$no_dot_version
|
||||
fi
|
||||
if test -z $PYTHON_INCLUDES; then
|
||||
PYTHON_INCLUDES="-I$PYTHON_PREFIX/include -mno-cygwin"
|
||||
fi
|
||||
if test -z $PYTHON_LDFLAGS; then
|
||||
PYTHON_LDFLAGS="-L$PYTHON_PREFIX/libs -lpython$no_dot_version -mno-cygwin"
|
||||
fi
|
||||
|
||||
# check whether Python.h and library exists
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PYTHON_INCLUDES"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
|
||||
|
||||
AC_MSG_CHECKING([PYTHON_INCLUDES])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <Python.h>
|
||||
int main ()
|
||||
{
|
||||
Py_Initialize();
|
||||
PyRun_SimpleString("from time import time,ctime\n"
|
||||
"print 'Today is',ctime(time())\n");
|
||||
Py_Finalize();
|
||||
return 0;
|
||||
}]])],[
|
||||
AC_MSG_RESULT([$PYTHON_INCLUDES])
|
||||
AC_MSG_CHECKING([PYTHON_LDFLAGS])
|
||||
AC_MSG_RESULT([$PYTHON_LDFLAGS])
|
||||
AC_MSG_NOTICE([Did not do real linking])
|
||||
AC_SUBST(PYTHON_INCLUDES)
|
||||
AC_SUBST(PYTHON_LDFLAGS)
|
||||
pyexecdir=$PYTHON_PREFIX/Lib/site-packages
|
||||
$2
|
||||
],[
|
||||
AC_MSG_RESULT([Not found])
|
||||
PYTHON_INCLUDES=""
|
||||
PYTHON_LDFLAGS=""
|
||||
PYTHON_EXTRA_LIBS=""
|
||||
])
|
||||
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _AC_PYTHON_DEVEL(action-if-found,action-if-not-found)
|
||||
# checks python headers and libs. it's
|
||||
# http://www.gnu.org/software/ac-archive/htmldoc/ac_python_devel.html,
|
||||
# modified to allow actions if-found/if-not-found
|
||||
#
|
||||
AC_DEFUN([_AC_PYTHON_DEVEL],[
|
||||
# Check for Python include path
|
||||
# if PYTHON_INCLUDES is set, do not do anything
|
||||
if test -z $PYTHON_INCLUDES; then
|
||||
python_found=no
|
||||
python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
|
||||
for i in "$python_path/include/python$PYTHON_VERSION/" "$python_path/include/python/" ; do
|
||||
if test -e "$i/Python.h"; then
|
||||
python_found=yes
|
||||
AC_MSG_CHECKING([for python include path])
|
||||
AC_MSG_RESULT([$i])
|
||||
PYTHON_INCLUDES="-I$i"
|
||||
AC_SUBST([PYTHON_INCLUDES],[$PYTHON_INCLUDES])
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test x$python_found = xno; then
|
||||
AC_MSG_CHECKING([for python include path])
|
||||
AC_MSG_RESULT([Not found])
|
||||
fi
|
||||
else
|
||||
python_found=yes
|
||||
AC_SUBST([PYTHON_INCLUDES],[$PYTHON_INCLUDES])
|
||||
fi
|
||||
|
||||
if test x$python_found = xyes; then
|
||||
# Check for Python library path
|
||||
AC_MSG_CHECKING([for Python library path])
|
||||
python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
|
||||
for i in "$python_path/lib/python$PYTHON_VERSION/config/" "$python_path/lib/python$PYTHON_VERSION/" "$python_path/lib/python/config/" "$python_path/lib/python/" "$python_path/" ; do
|
||||
python_path=`find $i -type f -name libpython$PYTHON_VERSION.* -print | sed "1q"`
|
||||
if test -n "$python_path" ; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
python_path=`echo $python_path | sed "s,/libpython.*$,,"`
|
||||
AC_MSG_RESULT([$python_path])
|
||||
if test -z "$python_path" ; then
|
||||
python_found=no
|
||||
else
|
||||
python_found=yes
|
||||
AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_VERSION"])
|
||||
python_site=`echo $python_path | sed "s/config/site-packages/"`
|
||||
AC_SUBST([PYTHON_SITE_PKG],[$python_site])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$python_found = xyes; then
|
||||
# libraries which must be linked in when embedding
|
||||
AC_MSG_CHECKING(python extra libraries)
|
||||
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
|
||||
conf = distutils.sysconfig.get_config_var; \
|
||||
print conf('LOCALMODLIBS')+' '+conf('LIBS')"
|
||||
AC_MSG_RESULT($PYTHON_EXTRA_LIBS)`
|
||||
AC_SUBST(PYTHON_EXTRA_LIBS)
|
||||
|
||||
AC_MSG_CHECKING([whether python can be used])
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PYTHON_INCLUDES"
|
||||
|
||||
# start AC_COMPILE_IFELSE in _AC_PYTHON_DEVEL
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <Python.h>
|
||||
int main ()
|
||||
{
|
||||
PyObject *object = NULL;
|
||||
return 0;
|
||||
}]])],[
|
||||
python_found=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_NOTICE([$PYTHON_INCLUDES $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS])
|
||||
],[
|
||||
python_found=no
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
# end AC_COMPILE_IFELSE in _AC_PYTHON_DEVEL
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
fi
|
||||
|
||||
if test x$python_found = xyes; then
|
||||
$1
|
||||
else
|
||||
$2
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _AC_CHECK_PYTHON_UNIX(min-version,action-if-found,action-if-not-found)
|
||||
# checks python stuff when building for unix
|
||||
#
|
||||
AC_DEFUN([_AC_CHECK_PYTHON_UNIX],[
|
||||
# _AC_CHECK_PYTHON_UNIX
|
||||
AM_PATH_PYTHON([$1],[
|
||||
_AC_PYTHON_DEVEL([
|
||||
python_found=yes
|
||||
],[
|
||||
AC_MSG_WARN([Found python interpreter but no development headers or libraries])
|
||||
python_found=no
|
||||
])
|
||||
],[
|
||||
python_found=no
|
||||
])
|
||||
|
||||
if test x$python_found = xyes; then
|
||||
$2
|
||||
else
|
||||
PYTHON_INCLUDES=""
|
||||
PYTHON_LDFLAGS=""
|
||||
PYTHON_EXTRA_LIBS=""
|
||||
$3
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# AC_CHECK_PYTHON(min-version,action-if-found,action-if-not-found)
|
||||
# checks for python, python includes and libs
|
||||
#
|
||||
AC_DEFUN([AC_CHECK_PYTHON],[
|
||||
AC_MSG_NOTICE([checking for headers and libs required to compile python extensions])
|
||||
if test x$mingw_build = xyes; then
|
||||
_AC_CHECK_PYTHON_MINGW([$1],[$2],[$3])
|
||||
else
|
||||
_AC_CHECK_PYTHON_UNIX([$1],[$2],[$3])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _AC_CHECK_PYGTK_MINGW(version,action-if-found,action-if-not-found)
|
||||
# checks pygtk stuff for mingw, it's broken
|
||||
#
|
||||
AC_DEFUN([_AC_CHECK_PYGTK_MINGW],[
|
||||
# _AC_CHECK_PYGTK_MINGW
|
||||
no_dot_version=`echo $1 | sed "s/\.//"`
|
||||
|
||||
if test -z $PYTHON_PARENT_DIR; then
|
||||
PYTHON_PARENT_DIR=/usr/local/win
|
||||
fi
|
||||
if test -z $PYTHON_PREFIX; then
|
||||
PYTHON_PREFIX=$PYTHON_PARENT_DIR/Python$no_dot_version
|
||||
fi
|
||||
if test -z $PYGTK_CFLAGS; then
|
||||
PYGTK_CFLAGS="-I$PYTHON_PREFIX/include/pygtk-2.0 $GTK_CFLAGS"
|
||||
fi
|
||||
|
||||
dnl check whether pygtk.h exists
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PYGTK_CFLAGS -I$PYTHON_PREFIX/include"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PYGTK_CFLAGS -I$PYTHON_PREFIX/include"
|
||||
|
||||
AC_MSG_CHECKING([for pygtk headers])
|
||||
# start AC_COMPILE_IFELSE in _AC_CHECK_PYGTK_MINGW
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <pygtk/pygtk.h>
|
||||
int main ()
|
||||
{
|
||||
init_pygtk();
|
||||
return 0;
|
||||
}]])],[
|
||||
AC_MSG_RESULT([$PYGTK_CFLAGS])
|
||||
AC_SUBST(PYGTK_CFLAGS)
|
||||
PYGTK_DEFS_DIR=$PYTHON_PREFIX/share/pygtk/2.0/defs
|
||||
AC_SUBST(PYGTK_DEFS_DIR)
|
||||
AC_MSG_NOTICE([pygtk defs dir: $PYGTK_DEFS_DIR])
|
||||
$2
|
||||
],[
|
||||
AC_MSG_RESULT([not found])
|
||||
$3
|
||||
])
|
||||
# end AC_COMPILE_IFELSE in _AC_CHECK_PYGTK_MINGW
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _AC_CHECK_PYGTK_UNIX(action-if-found,action-if-not-found)
|
||||
# checks pygtk stuff
|
||||
#
|
||||
AC_DEFUN([_AC_CHECK_PYGTK_UNIX],[
|
||||
# _AC_CHECK_PYGTK_UNIX
|
||||
AC_MSG_CHECKING([for pygtk headers])
|
||||
PKG_CHECK_MODULES(PYGTK,pygtk-2.0,[
|
||||
AC_MSG_RESULT([found])
|
||||
AC_MSG_CHECKING([whether pygtk can be used])
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PYGTK_CFLAGS $PYTHON_INCLUDES"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PYGTK_CFLAGS $PYTHON_INCLUDES"
|
||||
|
||||
# start AC_COMPILE_IFELSE in _AC_CHECK_PYGTK_UNIX
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <pygobject.h>
|
||||
int main ()
|
||||
{
|
||||
PyObject *object = pygobject_new (NULL);
|
||||
return 0;
|
||||
}]])],[
|
||||
AC_MSG_RESULT(yes)
|
||||
$2
|
||||
PYGTK_DEFS_DIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
|
||||
AC_SUBST(PYGTK_DEFS_DIR)
|
||||
AC_MSG_NOTICE([pygtk defs dir: $PYGTK_DEFS_DIR])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
$3
|
||||
])
|
||||
# end AC_COMPILE_IFELSE in _AC_CHECK_PYGTK_UNIX
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
],[
|
||||
AC_MSG_RESULT([not found])
|
||||
$3
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# AC_CHECK_PYGTK(version,action-if-found,action-if-not-found)
|
||||
# checks pygtk stuff
|
||||
# version argument is passed to _AC_CHECK_PYGTK_MINGW only
|
||||
#
|
||||
AC_DEFUN([AC_CHECK_PYGTK],[
|
||||
if test x$mingw_build = xyes; then
|
||||
_AC_CHECK_PYGTK_MINGW([$1],[$2],[$3])
|
||||
else
|
||||
_AC_CHECK_PYGTK_UNIX([$1],[$2],[$3])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# AC_PROG_WINDRES
|
||||
# checks whether windres is available, pretty broken
|
||||
#
|
||||
AC_DEFUN([AC_PROG_WINDRES],[
|
||||
case $host in
|
||||
*-*-mingw*|*-*-cygwin*)
|
||||
AC_MSG_CHECKING([for windres])
|
||||
found=
|
||||
if test -z $WINDRES; then
|
||||
if test "x$CC" != "x"; then
|
||||
WINDRES=`echo $CC | sed "s/gcc$//"`windres
|
||||
else
|
||||
WINDRES=windres
|
||||
fi
|
||||
fi
|
||||
found=`$WINDRES --version 2>/dev/null`
|
||||
if test "x$found" != "x"; then
|
||||
AC_MSG_RESULT([found $WINDRES])
|
||||
AC_SUBST(WINDRES)
|
||||
else
|
||||
AC_MSG_RESULT([not found])
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# AC_CHECK_XML_STUFF(action-if-found,action-if-not-found)
|
||||
# checks whether libxml2 is available, checks some functions and structures
|
||||
#
|
||||
AC_DEFUN([AC_CHECK_XML_STUFF],[
|
||||
PKG_CHECK_MODULES(XML,libxml-2.0,[
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $XML_CFLAGS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $XML_CFLAGS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $XML_LIBS"
|
||||
|
||||
AC_CHECK_FUNCS(xmlReadFile xmlParseFile)
|
||||
|
||||
AC_MSG_CHECKING([for xmlNode.line])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/tree.h>
|
||||
int main ()
|
||||
{
|
||||
xmlNode *node;
|
||||
int line;
|
||||
line = node->line;
|
||||
return 0;
|
||||
}]])],[
|
||||
AC_MSG_RESULT(present)
|
||||
AC_DEFINE(HAVE_XMLNODE_LINE,1,[Define if xmlNode structure has 'line' member])
|
||||
],[
|
||||
AC_MSG_RESULT(not present)
|
||||
])
|
||||
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
|
||||
MOO_XML_PKG_NAME=libxml-2.0
|
||||
|
||||
$1
|
||||
],[
|
||||
MOO_XML_PKG_NAME=
|
||||
$2
|
||||
])
|
||||
|
||||
AC_SUBST(MOO_XML_PKG_NAME)
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# AC_CHECK_DEBUG_STUFF(default-compiler-flags)
|
||||
#
|
||||
AC_DEFUN([AC_CHECK_DEBUG_STUFF],[
|
||||
DEBUG_CFLAGS=$1
|
||||
DEBUG_CXXFLAGS=$1
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[enable debug options (default = NO)]),[
|
||||
if test "x$enable_debug" = "xno"; then
|
||||
debug="no"
|
||||
else
|
||||
debug="yes"
|
||||
fi
|
||||
],[
|
||||
debug="no"
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(all-gcc-warnings,
|
||||
AC_HELP_STRING([--enable-all-gcc-warnings],[enable most of gcc warnings and turn on -pedantic mode (default = NO)]),[
|
||||
if test "x$enable_all_gcc_warnings" = "xno"; then
|
||||
all_gcc_warnings="no"
|
||||
elif test "x$enable_all_gcc_warnings" = "xfatal"; then
|
||||
all_gcc_warnings="yes"
|
||||
warnings_fatal="yes"
|
||||
else
|
||||
all_gcc_warnings="yes"
|
||||
warnings_fatal="no"
|
||||
fi
|
||||
],[
|
||||
all_gcc_warnings="no"
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(all-intel-warnings,
|
||||
AC_HELP_STRING([--enable-all-intel-warnings], [enable most of intel compiler warnings (default = NO)]),[
|
||||
if test x$enable_all_intel_warnings = "xno"; then
|
||||
all_intel_warnings="no"
|
||||
else
|
||||
all_intel_warnings="yes"
|
||||
fi
|
||||
],[
|
||||
all_intel_warnings="no"
|
||||
])
|
||||
|
||||
if test x$all_intel_warnings = "xyes"; then
|
||||
DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall -Wcheck -w2"
|
||||
DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -Wall -Wcheck -w2 -wd981,279,858,1418 -wd383"
|
||||
fi
|
||||
|
||||
if test x$all_gcc_warnings = "xyes"; then
|
||||
DEBUG_CFLAGS="$DEBUG_CFLAGS -W -Wall -Wpointer-arith dnl
|
||||
-Wcast-align -Wsign-compare -Winline -Wreturn-type dnl
|
||||
-Wwrite-strings -Wmissing-prototypes -Wmissing-declarations dnl
|
||||
-Wmissing-noreturn -Wmissing-format-attribute -Wnested-externs dnl
|
||||
-Wunreachable-code -Wdisabled-optimization"
|
||||
PYTHON_DEBUG_CFLAGS="$PYTHON_DEBUG_CFLAGS -Wall -Wpointer-arith dnl
|
||||
-Wcast-align -Wsign-compare -Winline -Wreturn-type dnl
|
||||
-Wmissing-prototypes -Wmissing-declarations dnl
|
||||
-Wmissing-noreturn -Wmissing-format-attribute -Wnested-externs dnl
|
||||
-Wunreachable-code -Wdisabled-optimization"
|
||||
DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -W -Wall -Woverloaded-virtual dnl
|
||||
-Wpointer-arith -Wcast-align -Wsign-compare -Wnon-virtual-dtor dnl
|
||||
-Wno-long-long -Wundef -Wconversion -Wchar-subscripts -Wwrite-strings dnl
|
||||
-Wmissing-format-attribute -Wcast-align -Wdisabled-optimization dnl
|
||||
-Wnon-template-friend -Wsign-promo -Wno-ctor-dtor-privacy"
|
||||
fi
|
||||
|
||||
if test x$debug = "xyes"; then
|
||||
flags="-DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED dnl
|
||||
-DGDK_DISABLE_DEPRECATED -DDEBUG -DENABLE_DEBUG -DENABLE_PROFILE dnl
|
||||
-DG_ENABLE_DEBUG -DG_ENABLE_PROFILE"
|
||||
else
|
||||
flags="-DNDEBUG=1 -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT"
|
||||
fi
|
||||
|
||||
DEBUG_CFLAGS="$DEBUG_CFLAGS $flags"
|
||||
PYTHON_DEBUG_CFLAGS="$PYTHON_DEBUG_CFLAGS $flags"
|
||||
DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS $flags"
|
||||
|
||||
if test "x$all_gcc_warnings" = "xyes" -a "x$warnings_fatal" = "xyes"; then
|
||||
DEBUG_CXXFlAGS_NO_WERROR=$DEBUG_CXXFLAGS
|
||||
DEBUG_CXXFLAGS="-Werror $DEBUG_CXXFLAGS"
|
||||
fi
|
||||
|
||||
AC_SUBST(DEBUG_CFLAGS)
|
||||
AC_SUBST(PYTHON_DEBUG_CFLAGS)
|
||||
AC_SUBST(DEBUG_CXXFLAGS)
|
||||
AC_SUBST(DEBUG_CXXFlAGS_NO_WERROR)
|
||||
|
||||
AC_MSG_CHECKING(for C compiler debug options)
|
||||
if test "x$DEBUG_CFLAGS" = "x"; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($DEBUG_CFLAGS)
|
||||
fi
|
||||
AC_MSG_CHECKING(for C++ compiler debug options)
|
||||
if test "x$DEBUG_CXXFLAGS" = "x"; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($DEBUG_CXXFLAGS)
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _CHECK_VERSION(pkg-name)
|
||||
#
|
||||
AC_DEFUN([_CHECK_VERSION],[
|
||||
if test x$cygwin_build != xyes; then
|
||||
PKG_CHECK_MODULES($1,$2)
|
||||
|
||||
AC_MSG_CHECKING($1 version)
|
||||
$1[]_VERSION=`$PKG_CONFIG --modversion $2`
|
||||
|
||||
i=0
|
||||
for part in `echo $[]$1[]_VERSION | sed 's/\./ /g'`; do
|
||||
i=`expr $i + 1`
|
||||
eval part$i=$part
|
||||
done
|
||||
|
||||
$1[]_MAJOR_VERSION=$part1
|
||||
$1[]_MINOR_VERSION=$part2
|
||||
$1[]_MICRO_VERSION=$part3
|
||||
|
||||
if test $[]$1[]_MINOR_VERSION -ge 8; then
|
||||
ver_2_8=yes
|
||||
fi
|
||||
if test $[]$1[]_MINOR_VERSION -ge 6; then
|
||||
ver_2_6=yes
|
||||
fi
|
||||
if test $[]$1[]_MINOR_VERSION -ge 4; then
|
||||
ver_2_4=yes
|
||||
fi
|
||||
if test $[]$1[]_MINOR_VERSION -ge 2; then
|
||||
ver_2_2=yes
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT($[]$1[]_MAJOR_VERSION.$[]$1[]_MINOR_VERSION.$[]$1[]_MICRO_VERSION)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL($1[]_2_8, test x$ver_2_8 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_6, test x$ver_2_6 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_4, test x$ver_2_4 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_2, test x$ver_2_2 = "xyes")
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# PKG_CHECK_GTK_VERSIONS
|
||||
#
|
||||
AC_DEFUN([PKG_CHECK_GTK_VERSIONS],[
|
||||
_CHECK_VERSION(GTK, gtk+-2.0)
|
||||
_CHECK_VERSION(GLIB, glib-2.0)
|
||||
_CHECK_VERSION(GDK, gdk-2.0)
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# AC_CHECK_FAM(action-if-found,action-if-not-found)
|
||||
#
|
||||
AC_DEFUN([AC_CHECK_FAM],[
|
||||
save_CFLAGS="$CFLAGS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
|
||||
CFLAGS="$CFLAGS $FAM_CFLAGS"
|
||||
if test x$FAM_LIBS = x; then
|
||||
FAM_LIBS=-lfam
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS $FAM_LIBS"
|
||||
|
||||
AC_CHECK_HEADERS(fam.h,[
|
||||
AC_CHECK_FUNCS([FAMMonitorDirectory FAMOpen],[fam_found=yes],[fam_found=no])
|
||||
],[fam_found=no])
|
||||
|
||||
if test x$fam_found != xno; then
|
||||
AC_SUBST(FAM_CFLAGS)
|
||||
AC_SUBST(FAM_LIBS)
|
||||
|
||||
AC_MSG_CHECKING(for FAM_CFLAGS)
|
||||
if test -z $FAM_CFLAGS; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($FAM_CFLAGS)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for FAM_LIBS)
|
||||
if test -z $FAM_LIBS; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($FAM_LIBS)
|
||||
fi
|
||||
|
||||
MOO_FAM_LIBS=$FAM_LIBS
|
||||
ifelse([$1], , :, [$1])
|
||||
else
|
||||
unset FAM_CFLAGS
|
||||
unset FAM_LIBS
|
||||
MOO_FAM_LIBS=
|
||||
ifelse([$2], , [AC_MSG_ERROR(libfam not found)], [$2])
|
||||
fi
|
||||
|
||||
AC_SUBST(MOO_FAM_LIBS)
|
||||
CFLAGS="$save_CFLAGS"
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
])
|
@ -39,11 +39,15 @@ if test x$LIBTOOLIZE = x; then
|
||||
export LIBTOOLIZE=libtoolize$lt_version
|
||||
fi
|
||||
|
||||
if test -d $srcdir/m4 ; then
|
||||
aclocal_extra="-I $srcdir/m4"
|
||||
fi
|
||||
|
||||
echo $LIBTOOLIZE --automake --copy && \
|
||||
$LIBTOOLIZE --automake --copy && \
|
||||
\
|
||||
echo $ACLOCAL && \
|
||||
$ACLOCAL && \
|
||||
echo $ACLOCAL $aclocal_extra && \
|
||||
$ACLOCAL $aclocal_extra && \
|
||||
\
|
||||
echo $AUTOHEADER && \
|
||||
$AUTOHEADER && \
|
||||
|
204
configure.ac
204
configure.ac
@ -38,7 +38,7 @@ AC_HEADER_STDC
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_WINDRES
|
||||
MOO_AC_PROG_WINDRES
|
||||
|
||||
|
||||
# for pcre
|
||||
@ -67,112 +67,36 @@ AC_HEADER_TIOCGWINSZ
|
||||
|
||||
# Check for PTY handling functions.
|
||||
AC_CHECK_FUNCS(cfmakeraw getpgid getpt grantpt unlockpt ptsname ptsname_r recvmsg)
|
||||
|
||||
|
||||
#
|
||||
################################################################################
|
||||
|
||||
|
||||
# Check debug options
|
||||
#
|
||||
# TODO TODO check gcc
|
||||
AC_CHECK_DEBUG_STUFF([-Wall])
|
||||
MOO_AC_CHECK_DEBUG_STUFF([-Wall])
|
||||
|
||||
|
||||
################################################################################
|
||||
# Check operating system
|
||||
#
|
||||
cygwin_build="no"
|
||||
mingw_build="no"
|
||||
case $host in
|
||||
*-*-mingw32*)
|
||||
echo "++++ building for MINGW32 ++++"
|
||||
mingw_build="yes"
|
||||
;;
|
||||
*-*-cygwin*)
|
||||
echo "++++ building for CYGWIN ++++"
|
||||
cygwin_build="yes"
|
||||
;;
|
||||
*-*-darwin*)
|
||||
echo "++++ building for DARWIN ++++"
|
||||
AC_DEFINE(MOO_OS_DARWIN, 1, [darwin])
|
||||
unix_build=yes
|
||||
;;
|
||||
*)
|
||||
unix_build=yes
|
||||
;;
|
||||
esac
|
||||
AM_CONDITIONAL(MOO_OS_UNIX, test x$unix_build = "xyes")
|
||||
AM_CONDITIONAL(MOO_OS_MINGW, test x$mingw_build = "xyes")
|
||||
AM_CONDITIONAL(MOO_OS_CYGWIN, test x$cygwin_build = "xyes")
|
||||
MOO_AC_CHECK_OS
|
||||
|
||||
|
||||
################################################################################
|
||||
# GTK libraries
|
||||
#
|
||||
PKG_CHECK_GTK_VERSIONS
|
||||
MOO_PKG_CHECK_GTK_VERSIONS
|
||||
|
||||
|
||||
################################################################################
|
||||
# File monitoring
|
||||
#
|
||||
if test x$unix_build = xyes; then
|
||||
AC_CHECK_FAM([has_fam=yes],[has_fam=no])
|
||||
if test x$has_fam = xyes; then
|
||||
AC_DEFINE(MOO_USE_FAM, 1, [use libfam for monitoring files])
|
||||
else
|
||||
AC_MSG_WARN([FAM or gamin not found. It is not required, everything will work but maybe not as well as with FAM.])
|
||||
fi
|
||||
fi
|
||||
MOO_AC_FAM
|
||||
|
||||
# Win32 file watch needs a thread for WaitForMultipleObjects
|
||||
if test x$mingw_build = xyes; then
|
||||
AC_DEFINE(MOO_NEED_THREAD, 1, [enable glib thread support])
|
||||
PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
|
||||
MOO_GTHREAD_PKG_NAME=gthread-2.0
|
||||
fi
|
||||
# libxml2
|
||||
MOO_AC_XML
|
||||
|
||||
AC_SUBST(MOO_GTHREAD_PKG_NAME)
|
||||
# xdgmime
|
||||
MOO_AC_XDGMIME
|
||||
|
||||
# Python stuff
|
||||
MOO_AC_PYGTK
|
||||
|
||||
|
||||
################################################################################
|
||||
# Python stuff
|
||||
# Python module
|
||||
#
|
||||
AC_ARG_WITH([pygtk],
|
||||
AC_HELP_STRING([--with-pygtk], [whether to compile pygtk support (default = autodetect)]),
|
||||
[
|
||||
if test x$with_pygtk = "xno"; then
|
||||
build_pygtk="no"
|
||||
else
|
||||
build_pygtk="yes"
|
||||
fi
|
||||
], [
|
||||
build_pygtk="yes"
|
||||
])
|
||||
|
||||
|
||||
AC_ARG_WITH([python],
|
||||
AC_HELP_STRING([--with-python], [whether to compile python support (default = AUTO)]),
|
||||
[
|
||||
if test x$with_python = "xno"; then
|
||||
build_python="no"
|
||||
build_pygtk="no"
|
||||
else
|
||||
if test x$with_python = "xyes"; then
|
||||
python_version=2.2
|
||||
else
|
||||
python_version=$with_python
|
||||
fi
|
||||
build_python="yes"
|
||||
fi
|
||||
], [
|
||||
if test x$build_pygtk = xyes; then
|
||||
build_python="yes"
|
||||
else
|
||||
build_python="auto"
|
||||
build_pygtk="no"
|
||||
fi
|
||||
python_version=2.2
|
||||
])
|
||||
|
||||
|
||||
AC_ARG_ENABLE([moo-module],
|
||||
AC_HELP_STRING([--enable-moo-module], [create standalone python module 'moo' (default = YES)]),
|
||||
[
|
||||
@ -185,50 +109,7 @@ AC_ARG_ENABLE([moo-module],
|
||||
build_pymoo="yes"
|
||||
])
|
||||
|
||||
|
||||
if test x$cygwin_build != "xyes" -a x$build_python != "xno"; then
|
||||
AC_CHECK_PYTHON($python_version,[
|
||||
build_python="yes"
|
||||
AC_MSG_NOTICE([compiling python support])
|
||||
],[
|
||||
build_python="no"
|
||||
build_pygtk="no"
|
||||
if test x$build_python = "xyes"; then
|
||||
AC_MSG_ERROR([Python not found])
|
||||
else
|
||||
AC_MSG_WARN([Python support will be disabled])
|
||||
fi
|
||||
])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MOO_USE_PYTHON, test x$build_python = "xyes")
|
||||
if test x$build_python = "xyes"; then
|
||||
AC_DEFINE(MOO_USE_PYTHON,, [MOO_USE_PYTHON])
|
||||
fi
|
||||
|
||||
|
||||
################################################################################
|
||||
# pygtk
|
||||
#
|
||||
if test x$cygwin_build != "xyes"; then
|
||||
if test x$build_pygtk = xyes; then
|
||||
AC_CHECK_PYGTK([$python_version],[
|
||||
build_pygtk="yes"
|
||||
AC_MSG_NOTICE([compiling pygtk support])
|
||||
],[
|
||||
build_pygtk="no"
|
||||
AC_MSG_NOTICE([usable pygtk not found])
|
||||
])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
AM_CONDITIONAL(MOO_USE_PYGTK, test x$build_pygtk = "xyes")
|
||||
if test x$build_pygtk = "xyes"; then
|
||||
AC_DEFINE(MOO_USE_PYGTK,, [MOO_USE_PYGTK])
|
||||
fi
|
||||
|
||||
if test x$build_pygtk = "xyes"; then
|
||||
if test x$MOO_USE_PYGTK = "xyes"; then
|
||||
if test x$build_pymoo != "xno"; then
|
||||
build_pymoo="yes"
|
||||
fi
|
||||
@ -239,43 +120,6 @@ fi
|
||||
AM_CONDITIONAL(BUILD_PYMOO, test x$build_pymoo = "xyes")
|
||||
|
||||
|
||||
################################################################################
|
||||
# libxml2
|
||||
#
|
||||
AC_ARG_WITH([xml],
|
||||
AC_HELP_STRING([--with-xml], [enable xml]),
|
||||
[use_xml=$withval],
|
||||
[use_xml=auto]
|
||||
)
|
||||
|
||||
if test x$cygwin_build != "xyes" -a x$use_xml != "xno"; then
|
||||
AC_CHECK_XML_STUFF([found_xml=yes],[found_xml=no])
|
||||
fi
|
||||
|
||||
if test x$use_xml = "xyes" -a x$found_xml = "xno"; then
|
||||
AC_MSG_ERROR([libxml2 library not found])
|
||||
fi
|
||||
if test x$found_xml = "xyes"; then
|
||||
use_xml=yes
|
||||
AC_MSG_NOTICE([compiling with xml support])
|
||||
AC_DEFINE(MOO_USE_XML,, [use libxml])
|
||||
else
|
||||
use_xml=no
|
||||
AC_MSG_NOTICE([compiling without xml support])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MOO_USE_XML, test x$use_xml = xyes)
|
||||
|
||||
|
||||
################################################################################
|
||||
# xdgmime
|
||||
#
|
||||
if test x$unix_build = "xyes"; then
|
||||
AC_DEFINE(MOO_USE_XDGMIME,, [use xdgmime])
|
||||
fi
|
||||
AM_CONDITIONAL(MOO_USE_XDGMIME, test x$unix_build = "xyes")
|
||||
|
||||
|
||||
################################################################################
|
||||
# Components
|
||||
#
|
||||
@ -301,7 +145,7 @@ AC_ARG_WITH([mooterm],
|
||||
)
|
||||
|
||||
|
||||
if test x$cygwin_build = "xyes"; then
|
||||
if test x$MOO_OS_CYGWIN = "xyes"; then
|
||||
build_mooutils="no"
|
||||
build_mooedit="no"
|
||||
build_mooapp="no"
|
||||
@ -313,7 +157,7 @@ fi
|
||||
if test "x$build_mooedit" != "xno"; then
|
||||
build_mooutils="yes"
|
||||
fi
|
||||
if test "x$build_mooterm" != "xno" -a x$cygwin_build != "xyes"; then
|
||||
if test "x$build_mooterm" != "xno" -a x$MOO_OS_CYGWIN != "xyes"; then
|
||||
build_mooutils="yes"
|
||||
fi
|
||||
|
||||
@ -348,7 +192,7 @@ moo_top_build_dir=`cd ./$ac_top_builddir && pwd`
|
||||
MOO_CFLAGS="-I$moo_top_src_dir/moo $GTK_CFLAGS -DXDG_PREFIX=_moo_edit_xdg -DG_LOG_DOMAIN=\\\"Moo\\\" -D__MOO__ -DMOO_MARSHALS_H=\\\"mooutils/moomarshals.h\\\""
|
||||
MOO_LIBS="$GTK_LIBS"
|
||||
|
||||
if test x$has_fam = xyes; then
|
||||
if test x$MOO_USE_FAM = xyes; then
|
||||
MOO_LIBS="$MOO_LIBS $FAM_LIBS"
|
||||
fi
|
||||
|
||||
@ -417,7 +261,6 @@ moo/mooedit/Makefile
|
||||
moo/mooedit/glade/Makefile
|
||||
moo/mooedit/syntax/Makefile
|
||||
moo/mooedit/plugins/Makefile
|
||||
moo/mooedit/plugins/cproject/Makefile
|
||||
moo/mooterm/Makefile
|
||||
moo/mooterm/termhelper_res.rc
|
||||
moo/mooterm/glade/Makefile
|
||||
@ -432,6 +275,7 @@ moo/mooutils/xdgmime/Makefile
|
||||
moo/moopython/Makefile
|
||||
tests/Makefile
|
||||
tests/pyapp.py
|
||||
m4/Makefile
|
||||
moo.pc
|
||||
])
|
||||
|
||||
@ -439,10 +283,10 @@ moo.pc
|
||||
################################################################################
|
||||
# Configuration info
|
||||
#
|
||||
if test x$cygwin_build != "xyes"; then
|
||||
if test "x$mingw_build" = "xyes"; then
|
||||
if test x$MOO_OS_CYGWIN != "xyes"; then
|
||||
if test "x$MOO_OS_MINGW" = "xyes"; then
|
||||
system="MINGW"
|
||||
elif test "x$darwin_build" = "xyes"; then
|
||||
elif test "x$MOO_OS_DARWIN" = "xyes"; then
|
||||
system="DARWIN"
|
||||
else
|
||||
system="UNIX"
|
||||
|
10
m4/Makefile.am
Normal file
10
m4/Makefile.am
Normal file
@ -0,0 +1,10 @@
|
||||
EXTRA_DIST = \
|
||||
moo-debug.m4 \
|
||||
moo-fam.m4 \
|
||||
moo-gtk.m4 \
|
||||
moo-os.m4 \
|
||||
moo-pygtk.m4 \
|
||||
moo-python.m4 \
|
||||
moo-windres.m4 \
|
||||
moo-xdgmime.m4 \
|
||||
moo-xml.m4
|
102
m4/moo-debug.m4
Normal file
102
m4/moo-debug.m4
Normal file
@ -0,0 +1,102 @@
|
||||
##############################################################################
|
||||
# MOO_AC_CHECK_DEBUG_STUFF(default-compiler-flags)
|
||||
#
|
||||
AC_DEFUN([MOO_AC_CHECK_DEBUG_STUFF],[
|
||||
MOO_DEBUG_CFLAGS=$1
|
||||
MOO_DEBUG_CXXFLAGS=$1
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[enable debug options (default = NO)]),[
|
||||
if test "x$enable_debug" = "xno"; then
|
||||
debug="no"
|
||||
else
|
||||
debug="yes"
|
||||
fi
|
||||
],[
|
||||
debug="no"
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(all-gcc-warnings,
|
||||
AC_HELP_STRING([--enable-all-gcc-warnings],[enable most of gcc warnings and turn on -pedantic mode (default = NO)]),[
|
||||
if test "x$enable_all_gcc_warnings" = "xno"; then
|
||||
all_gcc_warnings="no"
|
||||
elif test "x$enable_all_gcc_warnings" = "xfatal"; then
|
||||
all_gcc_warnings="yes"
|
||||
warnings_fatal="yes"
|
||||
else
|
||||
all_gcc_warnings="yes"
|
||||
warnings_fatal="no"
|
||||
fi
|
||||
],[
|
||||
all_gcc_warnings="no"
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(all-intel-warnings,
|
||||
AC_HELP_STRING([--enable-all-intel-warnings], [enable most of intel compiler warnings (default = NO)]),[
|
||||
if test x$enable_all_intel_warnings = "xno"; then
|
||||
all_intel_warnings="no"
|
||||
else
|
||||
all_intel_warnings="yes"
|
||||
fi
|
||||
],[
|
||||
all_intel_warnings="no"
|
||||
])
|
||||
|
||||
if test x$all_intel_warnings = "xyes"; then
|
||||
MOO_DEBUG_CFLAGS="$MOO_DEBUG_CFLAGS -Wall -Wcheck -w2"
|
||||
MOO_DEBUG_CXXFLAGS="$MOO_DEBUG_CXXFLAGS -Wall -Wcheck -w2 -wd981,279,858,1418 -wd383"
|
||||
fi
|
||||
|
||||
if test x$all_gcc_warnings = "xyes"; then
|
||||
MOO_DEBUG_CFLAGS="$MOO_DEBUG_CFLAGS -W -Wall -Wpointer-arith dnl
|
||||
-Wcast-align -Wsign-compare -Winline -Wreturn-type dnl
|
||||
-Wwrite-strings -Wmissing-prototypes -Wmissing-declarations dnl
|
||||
-Wmissing-noreturn -Wmissing-format-attribute -Wnested-externs dnl
|
||||
-Wunreachable-code -Wdisabled-optimization"
|
||||
MOO_PYTHON_DEBUG_CFLAGS="$MOO_PYTHON_DEBUG_CFLAGS -Wall -Wpointer-arith dnl
|
||||
-Wcast-align -Wsign-compare -Winline -Wreturn-type dnl
|
||||
-Wmissing-prototypes -Wmissing-declarations dnl
|
||||
-Wmissing-noreturn -Wmissing-format-attribute -Wnested-externs dnl
|
||||
-Wunreachable-code -Wdisabled-optimization"
|
||||
MOO_DEBUG_CXXFLAGS="$MOO_DEBUG_CXXFLAGS -W -Wall -Woverloaded-virtual dnl
|
||||
-Wpointer-arith -Wcast-align -Wsign-compare -Wnon-virtual-dtor dnl
|
||||
-Wno-long-long -Wundef -Wconversion -Wchar-subscripts -Wwrite-strings dnl
|
||||
-Wmissing-format-attribute -Wcast-align -Wdisabled-optimization dnl
|
||||
-Wnon-template-friend -Wsign-promo -Wno-ctor-dtor-privacy"
|
||||
fi
|
||||
|
||||
if test x$debug = "xyes"; then
|
||||
flags="-DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED dnl
|
||||
-DGDK_DISABLE_DEPRECATED -DDEBUG -DENABLE_DEBUG -DENABLE_PROFILE dnl
|
||||
-DG_ENABLE_DEBUG -DG_ENABLE_PROFILE"
|
||||
else
|
||||
flags="-DNDEBUG=1 -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT"
|
||||
fi
|
||||
|
||||
MOO_DEBUG_CFLAGS="$MOO_DEBUG_CFLAGS $flags"
|
||||
MOO_PYTHON_DEBUG_CFLAGS="$MOO_PYTHON_DEBUG_CFLAGS $flags"
|
||||
MOO_DEBUG_CXXFLAGS="$MOO_DEBUG_CXXFLAGS $flags"
|
||||
|
||||
if test "x$all_gcc_warnings" = "xyes" -a "x$warnings_fatal" = "xyes"; then
|
||||
MOO_DEBUG_CXXFlAGS_NO_WERROR=$MOO_DEBUG_CXXFLAGS
|
||||
MOO_DEBUG_CXXFLAGS="-Werror $MOO_DEBUG_CXXFLAGS"
|
||||
fi
|
||||
|
||||
AC_SUBST(MOO_DEBUG_CFLAGS)
|
||||
AC_SUBST(MOO_PYTHON_DEBUG_CFLAGS)
|
||||
AC_SUBST(MOO_DEBUG_CXXFLAGS)
|
||||
AC_SUBST(MOO_DEBUG_CXXFlAGS_NO_WERROR)
|
||||
|
||||
AC_MSG_CHECKING(for C compiler debug options)
|
||||
if test "x$MOO_DEBUG_CFLAGS" = "x"; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($MOO_DEBUG_CFLAGS)
|
||||
fi
|
||||
AC_MSG_CHECKING(for C++ compiler debug options)
|
||||
if test "x$MOO_DEBUG_CXXFLAGS" = "x"; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($MOO_DEBUG_CXXFLAGS)
|
||||
fi
|
||||
])
|
75
m4/moo-fam.m4
Normal file
75
m4/moo-fam.m4
Normal file
@ -0,0 +1,75 @@
|
||||
##############################################################################
|
||||
# MOO_AC_CHECK_FAM(action-if-found,action-if-not-found)
|
||||
#
|
||||
AC_DEFUN([MOO_AC_CHECK_FAM],[
|
||||
save_CFLAGS="$CFLAGS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
|
||||
CFLAGS="$CFLAGS $FAM_CFLAGS"
|
||||
if test x$FAM_LIBS = x; then
|
||||
FAM_LIBS=-lfam
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS $FAM_LIBS"
|
||||
|
||||
AC_CHECK_HEADERS(fam.h,[
|
||||
AC_CHECK_FUNCS([FAMMonitorDirectory FAMOpen],[fam_found=yes],[fam_found=no])
|
||||
],[fam_found=no])
|
||||
|
||||
if test x$fam_found != xno; then
|
||||
AC_SUBST(FAM_CFLAGS)
|
||||
AC_SUBST(FAM_LIBS)
|
||||
|
||||
AC_MSG_CHECKING(for FAM_CFLAGS)
|
||||
if test -z $FAM_CFLAGS; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($FAM_CFLAGS)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for FAM_LIBS)
|
||||
if test -z $FAM_LIBS; then
|
||||
AC_MSG_RESULT(None)
|
||||
else
|
||||
AC_MSG_RESULT($FAM_LIBS)
|
||||
fi
|
||||
|
||||
MOO_FAM_LIBS=$FAM_LIBS
|
||||
ifelse([$1], , :, [$1])
|
||||
else
|
||||
unset FAM_CFLAGS
|
||||
unset FAM_LIBS
|
||||
MOO_FAM_LIBS=
|
||||
ifelse([$2], , [AC_MSG_ERROR(libfam not found)], [$2])
|
||||
fi
|
||||
|
||||
AC_SUBST(MOO_FAM_LIBS)
|
||||
CFLAGS="$save_CFLAGS"
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([MOO_AC_FAM],[
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
|
||||
AC_ARG_WITH([fam], AC_HELP_STRING([--with-fam], [whether to use fam or gamin for monitoring files in the editor (default = NO)]), [
|
||||
if test x$with_fam = "xyes"; then
|
||||
MOO_USE_FAM="yes"
|
||||
else
|
||||
MOO_USE_FAM="no"
|
||||
fi
|
||||
],[
|
||||
MOO_USE_FAM="no"
|
||||
])
|
||||
|
||||
if test x$MOO_OS_UNIX = xyes -a x$MOO_USE_FAM = xyes; then
|
||||
MOO_AC_CHECK_FAM([moo_has_fam=yes],[moo_has_fam=no])
|
||||
if test x$moo_has_fam = xyes; then
|
||||
MOO_USE_FAM="yes"
|
||||
AC_DEFINE(MOO_USE_FAM, 1, [use libfam for monitoring files])
|
||||
else
|
||||
AC_MSG_ERROR([FAM or gamin not found.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MOO_USE_FAM, test x$MOO_USE_FAM = "xyes")
|
||||
])
|
48
m4/moo-gtk.m4
Normal file
48
m4/moo-gtk.m4
Normal file
@ -0,0 +1,48 @@
|
||||
##############################################################################
|
||||
# _MOO_CHECK_VERSION(pkg-name)
|
||||
#
|
||||
AC_DEFUN([_MOO_CHECK_VERSION],[
|
||||
if test x$MOO_OS_CYGWIN != xyes; then
|
||||
PKG_CHECK_MODULES($1,$2)
|
||||
|
||||
AC_MSG_CHECKING($1 version)
|
||||
$1[]_VERSION=`$PKG_CONFIG --modversion $2`
|
||||
|
||||
i=0
|
||||
for part in `echo $[]$1[]_VERSION | sed 's/\./ /g'`; do
|
||||
i=`expr $i + 1`
|
||||
eval part$i=$part
|
||||
done
|
||||
|
||||
$1[]_MAJOR_VERSION=$part1
|
||||
$1[]_MINOR_VERSION=$part2
|
||||
$1[]_MICRO_VERSION=$part3
|
||||
|
||||
for i in 2 4 6 8 10 12 14; do
|
||||
if test $[]$1[]_MINOR_VERSION -ge $i; then
|
||||
eval moo_ver_2_[]$i=yes
|
||||
fi
|
||||
done
|
||||
|
||||
AC_MSG_RESULT($[]$1[]_MAJOR_VERSION.$[]$1[]_MINOR_VERSION.$[]$1[]_MICRO_VERSION)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL($1[]_2_14, test x$moo_ver_2_14 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_12, test x$moo_ver_2_12 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_10, test x$moo_ver_2_10 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_8, test x$moo_ver_2_8 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_6, test x$moo_ver_2_6 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_4, test x$moo_ver_2_4 = "xyes")
|
||||
AM_CONDITIONAL($1[]_2_2, test x$moo_ver_2_2 = "xyes")
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MOO_PKG_CHECK_GTK_VERSIONS
|
||||
#
|
||||
AC_DEFUN([MOO_PKG_CHECK_GTK_VERSIONS],[
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
_MOO_CHECK_VERSION(GTK, gtk+-2.0)
|
||||
_MOO_CHECK_VERSION(GLIB, glib-2.0)
|
||||
_MOO_CHECK_VERSION(GDK, gdk-2.0)
|
||||
])
|
47
m4/moo-os.m4
Normal file
47
m4/moo-os.m4
Normal file
@ -0,0 +1,47 @@
|
||||
##############################################################################
|
||||
# MOO_AC_CHECK_OS([])
|
||||
#
|
||||
AC_DEFUN([MOO_AC_CHECK_OS],[
|
||||
MOO_OS_CYGWIN="no"
|
||||
MOO_OS_MINGW="no"
|
||||
MOO_OS_DARWIN="no"
|
||||
MOO_OS_UNIX="no"
|
||||
|
||||
case $host in
|
||||
*-*-mingw32*)
|
||||
echo "++++ building for MINGW32 ++++"
|
||||
MOO_OS_MINGW="yes"
|
||||
;;
|
||||
*-*-cygwin*)
|
||||
echo "++++ building for CYGWIN ++++"
|
||||
MOO_OS_CYGWIN="yes"
|
||||
;;
|
||||
*-*-darwin*)
|
||||
echo "++++ building for DARWIN ++++"
|
||||
MOO_OS_DARWIN="yes"
|
||||
MOO_OS_UNIX="yes"
|
||||
;;
|
||||
*)
|
||||
echo "++++ building for UNIX ++++"
|
||||
MOO_OS_UNIX="yes"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x$MOO_OS_DARWIN = xyes; then
|
||||
AC_DEFINE(MOO_OS_DARWIN, 1, [darwin])
|
||||
fi
|
||||
if test x$MOO_OS_UNIX = xyes; then
|
||||
AC_DEFINE(MOO_OS_UNIX, 1, [unix])
|
||||
fi
|
||||
if test x$MOO_OS_MINGW = xyes; then
|
||||
AC_DEFINE(MOO_OS_MINGW, 1, [mingw])
|
||||
fi
|
||||
if test x$MOO_OS_CYGWIN = xyes; then
|
||||
AC_DEFINE(MOO_OS_CYGWIN, 1, [cygwin])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MOO_OS_UNIX, test x$MOO_OS_UNIX = "xyes")
|
||||
AM_CONDITIONAL(MOO_OS_MINGW, test x$MOO_OS_MINGW = "xyes")
|
||||
AM_CONDITIONAL(MOO_OS_CYGWIN, test x$MOO_OS_CYGWIN = "xyes")
|
||||
AM_CONDITIONAL(MOO_OS_DARWIN, test x$MOO_OS_DARWIN = "xyes")
|
||||
])
|
190
m4/moo-pygtk.m4
Normal file
190
m4/moo-pygtk.m4
Normal file
@ -0,0 +1,190 @@
|
||||
##############################################################################
|
||||
# _MOO_AC_CHECK_PYGTK_MINGW(version,action-if-found,action-if-not-found)
|
||||
# checks pygtk stuff for mingw, it's broken
|
||||
#
|
||||
AC_DEFUN([_MOO_AC_CHECK_PYGTK_MINGW],[
|
||||
# _AC_CHECK_PYGTK_MINGW
|
||||
no_dot_version=`echo $1 | sed "s/\.//"`
|
||||
|
||||
if test -z $PYTHON_PARENT_DIR; then
|
||||
PYTHON_PARENT_DIR=/usr/local/win
|
||||
fi
|
||||
if test -z $PYTHON_PREFIX; then
|
||||
PYTHON_PREFIX=$PYTHON_PARENT_DIR/Python$no_dot_version
|
||||
fi
|
||||
if test -z $PYGTK_CFLAGS; then
|
||||
PYGTK_CFLAGS="-I$PYTHON_PREFIX/include/pygtk-2.0 $GTK_CFLAGS"
|
||||
fi
|
||||
|
||||
dnl check whether pygtk.h exists
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PYGTK_CFLAGS -I$PYTHON_PREFIX/include"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PYGTK_CFLAGS -I$PYTHON_PREFIX/include"
|
||||
|
||||
AC_MSG_CHECKING([for pygtk headers])
|
||||
# start AC_COMPILE_IFELSE in _AC_CHECK_PYGTK_MINGW
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <pygtk/pygtk.h>
|
||||
int main ()
|
||||
{
|
||||
init_pygtk();
|
||||
return 0;
|
||||
}]])],[
|
||||
AC_MSG_RESULT([$PYGTK_CFLAGS])
|
||||
AC_SUBST(PYGTK_CFLAGS)
|
||||
PYGTK_DEFS_DIR=$PYTHON_PREFIX/share/pygtk/2.0/defs
|
||||
AC_SUBST(PYGTK_DEFS_DIR)
|
||||
AC_MSG_NOTICE([pygtk defs dir: $PYGTK_DEFS_DIR])
|
||||
$2
|
||||
],[
|
||||
AC_MSG_RESULT([not found])
|
||||
$3
|
||||
])
|
||||
# end AC_COMPILE_IFELSE in _AC_CHECK_PYGTK_MINGW
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _MOO_AC_CHECK_PYGTK_UNIX(action-if-found,action-if-not-found)
|
||||
# checks pygtk stuff
|
||||
#
|
||||
AC_DEFUN([_MOO_AC_CHECK_PYGTK_UNIX],[
|
||||
# _AC_CHECK_PYGTK_UNIX
|
||||
AC_MSG_CHECKING([for pygtk headers])
|
||||
PKG_CHECK_MODULES(PYGTK,pygtk-2.0,[
|
||||
AC_MSG_RESULT([found])
|
||||
AC_MSG_CHECKING([whether pygtk can be used])
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PYGTK_CFLAGS $PYTHON_INCLUDES"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PYGTK_CFLAGS $PYTHON_INCLUDES"
|
||||
|
||||
# start AC_COMPILE_IFELSE in _AC_CHECK_PYGTK_UNIX
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <pygobject.h>
|
||||
int main ()
|
||||
{
|
||||
PyObject *object = pygobject_new (NULL);
|
||||
return 0;
|
||||
}]])],[
|
||||
AC_MSG_RESULT(yes)
|
||||
$2
|
||||
PYGTK_DEFS_DIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
|
||||
AC_SUBST(PYGTK_DEFS_DIR)
|
||||
AC_MSG_NOTICE([pygtk defs dir: $PYGTK_DEFS_DIR])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
$3
|
||||
])
|
||||
# end AC_COMPILE_IFELSE in _AC_CHECK_PYGTK_UNIX
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
],[
|
||||
AC_MSG_RESULT([not found])
|
||||
$3
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MOO_AC_CHECK_PYGTK(version,action-if-found,action-if-not-found)
|
||||
# checks pygtk stuff
|
||||
# version argument is passed to _AC_CHECK_PYGTK_MINGW only
|
||||
#
|
||||
AC_DEFUN([MOO_AC_CHECK_PYGTK],[
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
if test x$MOO_OS_CYGWIN != xyes; then
|
||||
if test x$MOO_OS_MINGW = xyes; then
|
||||
_MOO_AC_CHECK_PYGTK_MINGW([$1],[$2],[$3])
|
||||
else
|
||||
_MOO_AC_CHECK_PYGTK_UNIX([$1],[$2],[$3])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MOO_AC_PYGTK()
|
||||
#
|
||||
AC_DEFUN([MOO_AC_PYGTK],[
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
|
||||
AC_ARG_WITH([pygtk], AC_HELP_STRING([--with-pygtk], [whether to compile pygtk support (default = autodetect)]),[
|
||||
if test x$with_pygtk = "xno"; then
|
||||
MOO_USE_PYGTK="no"
|
||||
else
|
||||
MOO_USE_PYGTK="yes"
|
||||
fi
|
||||
],[
|
||||
MOO_USE_PYGTK="yes"
|
||||
])
|
||||
|
||||
AC_ARG_WITH([python],AC_HELP_STRING([--with-python], [whether to compile python support (default = autodetect)]),[
|
||||
if test x$with_python = "xno"; then
|
||||
MOO_USE_PYTHON="no"
|
||||
MOO_USE_PYTHON="no"
|
||||
else
|
||||
if test x$with_python = "xyes"; then
|
||||
moo_python_version=2.2
|
||||
else
|
||||
moo_python_version=$with_python
|
||||
fi
|
||||
MOO_USE_PYTHON="yes"
|
||||
fi
|
||||
],[
|
||||
if test x$MOO_USE_PYTGK = xyes; then
|
||||
MOO_USE_PYTHON="yes"
|
||||
else
|
||||
MOO_USE_PYTHON="auto"
|
||||
MOO_USE_PYTGK="no"
|
||||
fi
|
||||
moo_python_version=2.2
|
||||
])
|
||||
|
||||
if test x$MOO_OS_CYGWIN = xyes; then
|
||||
MOO_USE_PYTHON=no
|
||||
MOO_USE_PYGTK=no
|
||||
fi
|
||||
|
||||
if test x$MOO_USE_PYTHON != "xno"; then
|
||||
MOO_AC_CHECK_PYTHON($moo_python_version,[
|
||||
MOO_USE_PYTHON="yes"
|
||||
AC_MSG_NOTICE([compiling python support])
|
||||
],[
|
||||
MOO_USE_PYTHON="no"
|
||||
MOO_USE_PYGTK="no"
|
||||
if test x$MOO_USE_PYTHON = "xyes"; then
|
||||
AC_MSG_ERROR([Python not found])
|
||||
else
|
||||
AC_MSG_WARN([Python support will be disabled])
|
||||
fi
|
||||
])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MOO_USE_PYTHON, test x$MOO_USE_PYTHON = "xyes")
|
||||
if test x$MOO_USE_PYTHON = "xyes"; then
|
||||
AC_DEFINE(MOO_USE_PYTHON, 1, [MOO_USE_PYTHON])
|
||||
fi
|
||||
|
||||
### Pygtk
|
||||
|
||||
if test x$MOO_USE_PYGTK = xyes; then
|
||||
MOO_AC_CHECK_PYGTK([$moo_python_version],[
|
||||
MOO_USE_PYGTK="yes"
|
||||
AC_MSG_NOTICE([compiling pygtk support])
|
||||
],[
|
||||
MOO_USE_PYGTK="no"
|
||||
AC_MSG_NOTICE([usable pygtk not found])
|
||||
])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MOO_USE_PYGTK, test x$MOO_USE_PYGTK = "xyes")
|
||||
if test x$MOO_USE_PYGTK = "xyes"; then
|
||||
AC_DEFINE(MOO_USE_PYGTK, 1, [MOO_USE_PYGTK])
|
||||
fi
|
||||
])
|
201
m4/moo-python.m4
Normal file
201
m4/moo-python.m4
Normal file
@ -0,0 +1,201 @@
|
||||
##############################################################################
|
||||
# _MOO_AC_CHECK_PYTHON_MINGW(version,action-if-found,action-if-not-found)
|
||||
# checks python stuff when building for mingw. it's broken
|
||||
#
|
||||
AC_DEFUN([_MOO_AC_CHECK_PYTHON_MINGW],[
|
||||
no_dot_version=`echo $1 | sed "s/\.//"`
|
||||
|
||||
if test -z $PYTHON_PARENT_DIR; then
|
||||
PYTHON_PARENT_DIR=/usr/local/win
|
||||
fi
|
||||
if test -z $PYTHON_PREFIX; then
|
||||
PYTHON_PREFIX=$PYTHON_PARENT_DIR/Python$no_dot_version
|
||||
fi
|
||||
if test -z $PYTHON_INCLUDES; then
|
||||
PYTHON_INCLUDES="-I$PYTHON_PREFIX/include -mno-cygwin"
|
||||
fi
|
||||
if test -z $PYTHON_LDFLAGS; then
|
||||
PYTHON_LDFLAGS="-L$PYTHON_PREFIX/libs -lpython$no_dot_version -mno-cygwin"
|
||||
fi
|
||||
|
||||
# check whether Python.h and library exists
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PYTHON_INCLUDES"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
|
||||
|
||||
AC_MSG_CHECKING([PYTHON_INCLUDES])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <Python.h>
|
||||
int main ()
|
||||
{
|
||||
Py_Initialize();
|
||||
PyRun_SimpleString("from time import time,ctime\n"
|
||||
"print 'Today is',ctime(time())\n");
|
||||
Py_Finalize();
|
||||
return 0;
|
||||
}]])],[
|
||||
AC_MSG_RESULT([$PYTHON_INCLUDES])
|
||||
AC_MSG_CHECKING([PYTHON_LDFLAGS])
|
||||
AC_MSG_RESULT([$PYTHON_LDFLAGS])
|
||||
AC_MSG_NOTICE([Did not do real linking])
|
||||
AC_SUBST(PYTHON_INCLUDES)
|
||||
AC_SUBST(PYTHON_LDFLAGS)
|
||||
pyexecdir=$PYTHON_PREFIX/Lib/site-packages
|
||||
$2
|
||||
],[
|
||||
AC_MSG_RESULT([Not found])
|
||||
PYTHON_INCLUDES=""
|
||||
PYTHON_LDFLAGS=""
|
||||
PYTHON_EXTRA_LIBS=""
|
||||
])
|
||||
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _MOO_AC_PYTHON_DEVEL(action-if-found,action-if-not-found)
|
||||
# checks python headers and libs. it's
|
||||
# http://www.gnu.org/software/ac-archive/htmldoc/ac_python_devel.html,
|
||||
# modified to allow actions if-found/if-not-found
|
||||
#
|
||||
AC_DEFUN([_MOO_AC_PYTHON_DEVEL],[
|
||||
# Check for Python include path
|
||||
# if PYTHON_INCLUDES is set, do not do anything
|
||||
if test -z $PYTHON_INCLUDES; then
|
||||
python_found=no
|
||||
python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
|
||||
for i in "$python_path/include/python$PYTHON_VERSION/" "$python_path/include/python/" ; do
|
||||
if test -e "$i/Python.h"; then
|
||||
python_found=yes
|
||||
AC_MSG_CHECKING([for python include path])
|
||||
AC_MSG_RESULT([$i])
|
||||
PYTHON_INCLUDES="-I$i"
|
||||
AC_SUBST([PYTHON_INCLUDES],[$PYTHON_INCLUDES])
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test x$python_found = xno; then
|
||||
AC_MSG_CHECKING([for python include path])
|
||||
AC_MSG_RESULT([Not found])
|
||||
fi
|
||||
else
|
||||
python_found=yes
|
||||
AC_SUBST([PYTHON_INCLUDES],[$PYTHON_INCLUDES])
|
||||
fi
|
||||
|
||||
if test x$python_found = xyes; then
|
||||
# Check for Python library path
|
||||
AC_MSG_CHECKING([for Python library path])
|
||||
python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
|
||||
for i in "$python_path/lib/python$PYTHON_VERSION/config/" "$python_path/lib/python$PYTHON_VERSION/" "$python_path/lib/python/config/" "$python_path/lib/python/" "$python_path/" ; do
|
||||
python_path=`find $i -type f -name libpython$PYTHON_VERSION.* -print | sed "1q"`
|
||||
if test -n "$python_path" ; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
python_path=`echo $python_path | sed "s,/libpython.*$,,"`
|
||||
AC_MSG_RESULT([$python_path])
|
||||
if test -z "$python_path" ; then
|
||||
python_found=no
|
||||
else
|
||||
python_found=yes
|
||||
AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_VERSION"])
|
||||
python_site=`echo $python_path | sed "s/config/site-packages/"`
|
||||
AC_SUBST([PYTHON_SITE_PKG],[$python_site])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$python_found = xyes; then
|
||||
# libraries which must be linked in when embedding
|
||||
AC_MSG_CHECKING(python extra libraries)
|
||||
PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
|
||||
conf = distutils.sysconfig.get_config_var; \
|
||||
print conf('LOCALMODLIBS')+' '+conf('LIBS')"
|
||||
AC_MSG_RESULT($PYTHON_EXTRA_LIBS)`
|
||||
AC_SUBST(PYTHON_EXTRA_LIBS)
|
||||
|
||||
AC_MSG_CHECKING([whether python can be used])
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $PYTHON_INCLUDES"
|
||||
|
||||
# start AC_COMPILE_IFELSE in _AC_PYTHON_DEVEL
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <Python.h>
|
||||
int main ()
|
||||
{
|
||||
PyObject *object = NULL;
|
||||
return 0;
|
||||
}]])],[
|
||||
python_found=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_NOTICE([$PYTHON_INCLUDES $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS])
|
||||
],[
|
||||
python_found=no
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
# end AC_COMPILE_IFELSE in _AC_PYTHON_DEVEL
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
fi
|
||||
|
||||
if test x$python_found = xyes; then
|
||||
$1
|
||||
else
|
||||
$2
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# _MOO_AC_CHECK_PYTHON_UNIX(min-version,action-if-found,action-if-not-found)
|
||||
# checks python stuff when building for unix
|
||||
#
|
||||
AC_DEFUN([_MOO_AC_CHECK_PYTHON_UNIX],[
|
||||
AM_PATH_PYTHON([$1],[
|
||||
_MOO_AC_PYTHON_DEVEL([
|
||||
python_found=yes
|
||||
],[
|
||||
AC_MSG_WARN([Found python interpreter but no development headers or libraries])
|
||||
python_found=no
|
||||
])
|
||||
],[
|
||||
python_found=no
|
||||
])
|
||||
|
||||
if test x$python_found = xyes; then
|
||||
$2
|
||||
else
|
||||
PYTHON_INCLUDES=""
|
||||
PYTHON_LDFLAGS=""
|
||||
PYTHON_EXTRA_LIBS=""
|
||||
$3
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MOO_AC_CHECK_PYTHON(min-version,action-if-found,action-if-not-found)
|
||||
# checks for python, python includes and libs
|
||||
#
|
||||
AC_DEFUN([MOO_AC_CHECK_PYTHON],[
|
||||
AC_MSG_NOTICE([checking for headers and libs required to compile python extensions])
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
if test x$MOO_OS_CYGWIN != xyes; then
|
||||
if test x$MOO_OS_MINGW = xyes; then
|
||||
_MOO_AC_CHECK_PYTHON_MINGW([$1],[$2],[$3])
|
||||
else
|
||||
_MOO_AC_CHECK_PYTHON_UNIX([$1],[$2],[$3])
|
||||
fi
|
||||
fi
|
||||
])
|
28
m4/moo-windres.m4
Normal file
28
m4/moo-windres.m4
Normal file
@ -0,0 +1,28 @@
|
||||
##############################################################################
|
||||
# MOO_AC_PROG_WINDRES
|
||||
# checks whether windres is available, pretty broken
|
||||
#
|
||||
AC_DEFUN([MOO_AC_PROG_WINDRES],[
|
||||
case $host in
|
||||
*-*-mingw*|*-*-cygwin*)
|
||||
AC_MSG_CHECKING([for windres])
|
||||
found=
|
||||
if test -z $WINDRES; then
|
||||
if test "x$CC" != "x"; then
|
||||
WINDRES=`echo $CC | sed "s/gcc$//"`windres
|
||||
else
|
||||
WINDRES=windres
|
||||
fi
|
||||
fi
|
||||
found=`$WINDRES --version 2>/dev/null`
|
||||
if test "x$found" != "x"; then
|
||||
AC_MSG_RESULT([found $WINDRES])
|
||||
AC_SUBST(WINDRES)
|
||||
else
|
||||
AC_MSG_RESULT([not found])
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
])
|
12
m4/moo-xdgmime.m4
Normal file
12
m4/moo-xdgmime.m4
Normal file
@ -0,0 +1,12 @@
|
||||
##############################################################################
|
||||
# MOO_AC_XDGMIME([])
|
||||
# does nothing, just defines MOO_USE_XDGMIME on unix
|
||||
#
|
||||
AC_DEFUN([MOO_AC_XDGMIME],[
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
|
||||
if test x$MOO_OS_UNIX = "xyes"; then
|
||||
AC_DEFINE(MOO_USE_XDGMIME, 1, [use xdgmime])
|
||||
fi
|
||||
AM_CONDITIONAL(MOO_USE_XDGMIME, test x$MOO_OS_UNIX = "xyes")
|
||||
])
|
83
m4/moo-xml.m4
Normal file
83
m4/moo-xml.m4
Normal file
@ -0,0 +1,83 @@
|
||||
##############################################################################
|
||||
# MOO_AC_CHECK_XML_STUFF(action-if-found,action-if-not-found)
|
||||
# checks whether libxml2 is available, checks some functions and structures
|
||||
#
|
||||
AC_DEFUN([MOO_AC_CHECK_XML_STUFF],[
|
||||
PKG_CHECK_MODULES(XML,libxml-2.0,[
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $XML_CFLAGS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $XML_CFLAGS"
|
||||
save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $XML_LIBS"
|
||||
|
||||
AC_CHECK_FUNCS(xmlReadFile xmlParseFile)
|
||||
|
||||
AC_MSG_CHECKING([for xmlNode.line])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/tree.h>
|
||||
int main ()
|
||||
{
|
||||
xmlNode *node;
|
||||
int line;
|
||||
line = node->line;
|
||||
return 0;
|
||||
}]])],[
|
||||
AC_MSG_RESULT(present)
|
||||
AC_DEFINE(HAVE_XMLNODE_LINE,1,[Define if xmlNode structure has 'line' member])
|
||||
],[
|
||||
AC_MSG_RESULT(not present)
|
||||
])
|
||||
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
|
||||
MOO_XML_PKG_NAME=libxml-2.0
|
||||
|
||||
$1
|
||||
],[
|
||||
MOO_XML_PKG_NAME=
|
||||
$2
|
||||
])
|
||||
|
||||
AC_SUBST(MOO_XML_PKG_NAME)
|
||||
])
|
||||
|
||||
|
||||
##############################################################################
|
||||
# MOO_AC_XML([])
|
||||
#
|
||||
AC_DEFUN([MOO_AC_XML],[
|
||||
AC_REQUIRE([MOO_AC_CHECK_OS])
|
||||
|
||||
MOO_USE_XML="no"
|
||||
|
||||
AC_ARG_WITH([xml],
|
||||
AC_HELP_STRING([--with-xml], [whether to use libxml2 (default: use if present)]),
|
||||
[MOO_USE_XML=$withval],
|
||||
[MOO_USE_XML=auto]
|
||||
)
|
||||
|
||||
if test x$MOO_OS_CYGWIN != "xyes"; then
|
||||
if test x$MOO_USE_XML != "xno"; then
|
||||
MOO_AC_CHECK_XML_STUFF([moo_found_xml=yes],[moo_found_xml=no])
|
||||
fi
|
||||
|
||||
if test x$MOO_USE_XML = "xyes" -a x$moo_found_xml = "xno"; then
|
||||
AC_MSG_ERROR([libxml2 library not found])
|
||||
fi
|
||||
|
||||
if test x$moo_found_xml = "xyes"; then
|
||||
MOO_USE_XML=yes
|
||||
AC_MSG_NOTICE([compiling with xml support])
|
||||
AC_DEFINE(MOO_USE_XML, 1, [use libxml])
|
||||
else
|
||||
MOO_USE_XML=no
|
||||
AC_MSG_NOTICE([compiling without xml support])
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(MOO_USE_XML, test x$MOO_USE_XML = xyes)
|
||||
])
|
@ -268,16 +268,16 @@
|
||||
</kdevdoctreeview>
|
||||
<kdevfilecreate>
|
||||
<filetypes>
|
||||
<type icon="source" ext="g" create="template" name="GAP source" >
|
||||
<type icon="source" ext="g" name="GAP source" create="template" >
|
||||
<descr>A new empty GAP source file</descr>
|
||||
</type>
|
||||
<type icon="source_cpp" ext="cpp" create="template" name="C++ Source" >
|
||||
<type icon="source_cpp" ext="cpp" name="C++ Source" create="template" >
|
||||
<descr>A new empty C++ file.</descr>
|
||||
</type>
|
||||
<type icon="source_h" ext="h" create="template" name="C/C++ Header" >
|
||||
<type icon="source_h" ext="h" name="C/C++ Header" create="template" >
|
||||
<descr>A new empty header file for C/C++.</descr>
|
||||
</type>
|
||||
<type icon="source_c" ext="c" create="template" name="C Source" >
|
||||
<type icon="source_c" ext="c" name="C Source" create="template" >
|
||||
<descr>A new empty C file.</descr>
|
||||
</type>
|
||||
</filetypes>
|
||||
|
@ -70,7 +70,7 @@ AM_CFLAGS = \
|
||||
$(MOO_CFLAGS) \
|
||||
$(PYTHON_INCLUDES) \
|
||||
$(PYGTK_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(CFLAGS)
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@ AM_CFLAGS = \
|
||||
$(PYTHON_INCLUDES) \
|
||||
$(PYGTK_CFLAGS) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libmooapp.la
|
||||
|
@ -10,7 +10,7 @@ AM_CFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_builddir)/$(MOO_SRC_PREFIX) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libmooedit.la
|
||||
|
@ -2,15 +2,12 @@
|
||||
# mooedit/plugins/Makefile.am
|
||||
#
|
||||
|
||||
DIST_SUBDIRS = cproject
|
||||
SUBDIRS =
|
||||
|
||||
DEFAULT_INCLUDES =
|
||||
AM_CFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_builddir)/$(MOO_SRC_PREFIX) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libplugins.la
|
||||
@ -20,7 +17,6 @@ unix_sources = \
|
||||
moofind.c \
|
||||
moofind-glade.h \
|
||||
fileselector.c
|
||||
SUBDIRS += cproject
|
||||
if MOO_BUILD_TERM
|
||||
unix_sources += console.c
|
||||
endif
|
||||
|
@ -7,7 +7,7 @@ AM_CFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_builddir)/$(MOO_SRC_PREFIX) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(PYTHON_DEBUG_CFLAGS) \
|
||||
$(MOO_PYTHON_DEBUG_CFLAGS) \
|
||||
$(CFLAGS) \
|
||||
$(GTK_CFLAGS) \
|
||||
$(PYTHON_INCLUDES) \
|
||||
|
@ -65,7 +65,7 @@ common_cflags = \
|
||||
$(MOO_CFLAGS) \
|
||||
$(GTK_CFLAGS)
|
||||
|
||||
AM_CFLAGS = $(common_cflags) $(DEBUG_CFLAGS) $(CFLAGS)
|
||||
AM_CFLAGS = $(common_cflags) $(MOO_DEBUG_CFLAGS) $(CFLAGS)
|
||||
|
||||
EXTRA_DIST = \
|
||||
mootermparser-yacc.y \
|
||||
|
@ -19,7 +19,7 @@ AM_CFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_builddir)/$(MOO_SRC_PREFIX) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(CFLAGS) \
|
||||
$(PYTHON_INCLUDES) \
|
||||
$(PYGTK_CFLAGS)
|
||||
|
@ -23,7 +23,7 @@ AM_CFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_builddir)/$(MOO_SRC_PREFIX) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(CFLAGS)
|
||||
|
||||
libmoofileview_la_SOURCES = \
|
||||
|
@ -7,7 +7,7 @@ AM_CFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/$(MOO_SRC_PREFIX) \
|
||||
-I$(top_builddir)/$(MOO_SRC_PREFIX) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(CFLAGS) \
|
||||
$(XML_CFLAGS) \
|
||||
$(GTK_CFLAGS) \
|
||||
|
@ -35,7 +35,7 @@ bin_PROGRAMS += $(medit)
|
||||
AM_CFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(DEBUG_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(CFLAGS) \
|
||||
$(GTK_CFLAGS)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user