Added options for building library and python module

master
Yevgen Muntyan 2006-12-19 21:58:30 -06:00
parent b073b164cd
commit c370937807
7 changed files with 103 additions and 83 deletions

View File

@ -9,6 +9,7 @@ m4files = \
m4/moo-funcs.m4 \
m4/moo-gtk.m4 \
m4/moo-i18n.m4 \
m4/moo-lib.m4 \
m4/moo-os.m4 \
m4/moo-pcre.m4 \
m4/moo-progs.m4 \
@ -47,7 +48,11 @@ CLEANFILES = pot-subdirs-stamp
DIST_SUBDIRS = moo medit tests po
# need to create pot-subdirs-stamp before it goes to po/
if MOO_BUILD_MEDIT
SUBDIRS = . moo medit po
else
SUBDIRS = . moo po
endif
if MOO_ENABLE_TESTS
SUBDIRS += tests

View File

@ -2,8 +2,8 @@
# MOO_AC_CHECK_FAM(action-if-found,action-if-not-found)
#
AC_DEFUN([MOO_AC_CHECK_FAM],[
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
moo_ac_save_CFLAGS="$CFLAGS"
moo_ac_save_LDFLAGS="$LDFLAGS"
if test x$FAM_LIBS = x; then
FAM_LIBS=-lfam
@ -52,8 +52,8 @@ AC_DEFUN([MOO_AC_CHECK_FAM],[
AC_SUBST(MOO_FAM_CFLAGS)
AC_SUBST(MOO_FAM_LIBS)
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
CFLAGS="$moo_ac_save_CFLAGS"
LDFLAGS="$moo_ac_save_LDFLAGS"
])

View File

@ -1,4 +1,4 @@
AC_DEFUN([_MOO_AC_CONFIGURE_ARGS],[
AC_DEFUN([_MOO_AC_CONFIGARGS_H],[
moo_ac_configure_args=`echo "$ac_configure_args" | sed 's/^ //; s/\\""\`\$/\\\\&/g'`
cat >configargs.h.tmp <<EOF
static const char configure_args@<:@@:>@ = "$moo_ac_configure_args";
@ -21,55 +21,45 @@ AC_DEFUN([MOO_AC_FLAGS],[
AC_REQUIRE([MOO_AC_XDGMIME])
AC_REQUIRE([MOO_AC_PYGTK])
AC_REQUIRE([MOO_AC_PCRE])
AC_REQUIRE([_MOO_AC_LIB])
if test x$MOO_OS_UNIX != xyes; then
AM_CONDITIONAL(MOO_INSTALL_LIB, true)
AM_CONDITIONAL(MOO_BUILD_PYTHON_MODULE, true)
AC_DEFINE(MOO_BUILD_PYTHON_MODULE, 1, MOO_BUILD_PYTHON_MODULE)
AM_CONDITIONAL(MOO_INSTALL_HEADERS, false)
else
AM_CONDITIONAL(MOO_INSTALL_LIB, false)
AM_CONDITIONAL(MOO_BUILD_PYTHON_MODULE, false)
AM_CONDITIONAL(MOO_INSTALL_HEADERS, false)
moo_top_src_dir=`cd $srcdir && pwd`
MOO_CFLAGS="$MOO_CFLAGS -I"$moo_top_src_dir/$1" $GTK_CFLAGS $MOO_PCRE_CFLAGS -DXDG_PREFIX=_moo_edit_xdg -DG_LOG_DOMAIN=\\\"Moo\\\""
MOO_LIBS="$MOO_LIBS $GTK_LIBS $MOO_PCRE_LIBS"
if test x$MOO_OS_MINGW = xyes; then
MOO_LIBS="$MOO_LIBS $GTHREAD_LIBS"
fi;
if test x$MOO_USE_FAM = xyes; then
MOO_CFLAGS="$MOO_CFLAGS $MOO_FAM_CFLAGS"
MOO_LIBS="$MOO_LIBS $MOO_FAM_LIBS"
fi
moo_top_src_dir=`cd $srcdir && pwd`
MOO_CFLAGS="$MOO_CFLAGS -I"$moo_top_src_dir/$1" $GTK_CFLAGS $MOO_PCRE_CFLAGS -DXDG_PREFIX=_moo_edit_xdg -DG_LOG_DOMAIN=\\\"Moo\\\""
MOO_LIBS="$MOO_LIBS $GTK_LIBS $MOO_PCRE_LIBS"
MOO_CFLAGS="$MOO_CFLAGS -DMOO_DATA_DIR=\\\"${MOO_DATA_DIR}\\\" -DMOO_LIB_DIR=\\\"${MOO_LIB_DIR}\\\""
if test x$MOO_OS_MINGW = xyes; then
MOO_LIBS="$MOO_LIBS $GTHREAD_LIBS"
fi;
if test x$MOO_USE_GTKHTML = xyes; then
MOO_CFLAGS="$MOO_CFLAGS $GTKHTML_CFLAGS"
MOO_LIBS="$MOO_LIBS $GTKHTML_LIBS"
fi
if test x$MOO_USE_FAM = xyes; then
MOO_CFLAGS="$MOO_CFLAGS $MOO_FAM_CFLAGS"
MOO_LIBS="$MOO_LIBS $MOO_FAM_LIBS"
fi
################################################################################
# MooEdit stuff
#
if test "x$build_mooedit" != "xno"; then
MOO_CFLAGS="$MOO_CFLAGS $XML_CFLAGS"
MOO_LIBS="$MOO_LIBS $XML_LIBS"
fi
MOO_CFLAGS="$MOO_CFLAGS -DMOO_DATA_DIR=\\\"${MOO_DATA_DIR}\\\" -DMOO_LIB_DIR=\\\"${MOO_LIB_DIR}\\\""
AC_SUBST(MOO_CFLAGS)
AC_SUBST(MOO_LIBS)
if test x$MOO_USE_GTKHTML = xyes; then
MOO_CFLAGS="$MOO_CFLAGS $GTKHTML_CFLAGS"
MOO_LIBS="$MOO_LIBS $GTKHTML_LIBS"
fi
_MOO_AC_CONFIGARGS_H
################################################################################
# MooEdit stuff
#
if test "x$build_mooedit" != "xno"; then
MOO_CFLAGS="$MOO_CFLAGS $XML_CFLAGS"
MOO_LIBS="$MOO_LIBS $XML_LIBS"
fi
AC_SUBST(MOO_CFLAGS)
AC_SUBST(MOO_LIBS)
_MOO_AC_CONFIGURE_ARGS
MOO_INI_IN_IN_RULE='%.ini.desktop.in: %.ini.desktop.in.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]@'
MOO_INI_IN_RULE='%.ini: %.ini.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]@'
MOO_WIN32_RC_RULE='%.res: %.rc.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]*.rc && cd $(subdir) && $(WINDRES) -i [$]*.rc --input-format=rc -o [$]@ -O coff && rm [$]*.rc'
AC_SUBST(MOO_INI_IN_IN_RULE)
AC_SUBST(MOO_INI_IN_RULE)
AC_SUBST(MOO_WIN32_RC_RULE)
MOO_INI_IN_IN_RULE='%.ini.desktop.in: %.ini.desktop.in.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]@'
MOO_INI_IN_RULE='%.ini: %.ini.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]@'
MOO_WIN32_RC_RULE='%.res: %.rc.in $(top_builddir)/config.status ; cd $(top_builddir) && $(SHELL) ./config.status --file=$(subdir)/[$]*.rc && cd $(subdir) && $(WINDRES) -i [$]*.rc --input-format=rc -o [$]@ -O coff && rm [$]*.rc'
AC_SUBST(MOO_INI_IN_IN_RULE)
AC_SUBST(MOO_INI_IN_RULE)
AC_SUBST(MOO_WIN32_RC_RULE)
])

39
m4/moo-lib.m4 Normal file
View File

@ -0,0 +1,39 @@
AC_DEFUN([_MOO_AC_LIB],[
AC_ARG_ENABLE(libmoo,
AC_HELP_STRING([--enable-libmoo], [build and install libmoo library (default = NO)]),
[MOO_INSTALL_LIB="$enableval"],[
if test x$MOO_OS_UNIX != xyes; then
MOO_INSTALL_LIB="yes"
else
MOO_INSTALL_LIB="no"
fi
])
AC_ARG_ENABLE(libmoo-headers,
AC_HELP_STRING([--enable-libmoo-headers], [install libmoo library headers (default = NO)]),
[MOO_INSTALL_HEADERS="$enableval"],[MOO_INSTALL_HEADERS="no"]
)
AC_ARG_ENABLE(moo-module,
AC_HELP_STRING([--enable-moo-module], [install python module (default = NO)]),
[MOO_BUILD_PYTHON_MODULE="$enableval"],[
if test "x$MOO_OS_UNIX" != "xyes"; then
MOO_BUILD_PYTHON_MODULE="yes"
else
MOO_BUILD_PYTHON_MODULE="no"
fi
])
AC_ARG_ENABLE(medit,
AC_HELP_STRING([--disable-medit], [do not build medit (default = NO)]),
[MOO_BUILD_MEDIT="$enableval"],[MOO_BUILD_MEDIT="yes"])
AM_CONDITIONAL(MOO_INSTALL_LIB, test "x$MOO_INSTALL_LIB" = "xyes")
AM_CONDITIONAL(MOO_INSTALL_HEADERS, test "x$MOO_INSTALL_HEADERS" = "xyes")
AM_CONDITIONAL(MOO_BUILD_PYTHON_MODULE, test "x$MOO_BUILD_PYTHON_MODULE" = "xyes")
AM_CONDITIONAL(MOO_BUILD_MEDIT, test "x$MOO_BUILD_MEDIT" = "xyes")
if test "x$MOO_BUILD_PYTHON_MODULE" = "xyes"; then
AC_DEFINE(MOO_BUILD_PYTHON_MODULE, 1, [build python module])
fi
])

View File

@ -28,11 +28,11 @@ if test x$MOO_BUILD_PCRE != xyes; then
if test $have_pcre = yes; then
AC_MSG_CHECKING(pcre UTF8 support)
save_CPPFLAGS="$CPPFLAGS"
moo_ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
save_CFLAGS="$CFLAGS"
moo_ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PCRE_CFLAGS"
save_LDFLAGS="$LDFLAGS"
moo_ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $PCRE_LIBS"
AC_RUN_IFELSE([
@ -64,9 +64,9 @@ if test x$MOO_BUILD_PCRE != xyes; then
have_pcre=yes
])
CFLAGS="$save_CFLAGS"
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
CFLAGS="$moo_ac_save_CFLAGS"
CPPFLAGS="$moo_ac_save_CPPFLAGS"
LDFLAGS="$moo_ac_save_LDFLAGS"
fi
fi

View File

@ -25,11 +25,11 @@ AC_DEFUN([_MOO_AC_CHECK_PYTHON_MINGW],[
# check whether Python.h and library exists
save_CPPFLAGS="$CPPFLAGS"
moo_ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON[]$1[]_CFLAGS"
save_CFLAGS="$CFLAGS"
moo_ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PYTHON[]$1[]_CFLAGS"
save_LDFLAGS="$LDFLAGS"
moo_ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $PYTHON[]$1[]_LIBS"
AC_MSG_CHECKING([PYTHON[]$1[]_CFLAGS])
@ -59,9 +59,9 @@ AC_DEFUN([_MOO_AC_CHECK_PYTHON_MINGW],[
$3
])
LDFLAGS="$save_LDFLAGS"
CFLAGS="$save_CFLAGS"
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$moo_ac_save_LDFLAGS"
CFLAGS="$moo_ac_save_CFLAGS"
CPPFLAGS="$moo_ac_save_CPPFLAGS"
])

View File

@ -4,35 +4,21 @@
#
AC_DEFUN([MOO_AC_CHECK_XML_STUFF],[
PKG_CHECK_MODULES(XML,libxml-2.0,[
save_CPPFLAGS="$CPPFLAGS"
moo_ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $XML_CFLAGS"
save_CFLAGS="$CFLAGS"
moo_ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $XML_CFLAGS"
save_LDFLAGS="$LDFLAGS"
moo_ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $XML_LIBS"
AC_CHECK_FUNCS(xmlReadFile xmlParseFile)
AC_CHECK_MEMBER([xmlNode.line],
[AC_DEFINE(HAVE_XMLNODE_LINE,1,[Define if xmlNode structure has 'line' member])],
[],[#include <libxml/tree.h>])
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"
LDFLAGS="$moo_ac_save_LDFLAGS"
CFLAGS="$moo_ac_save_CFLAGS"
CPPFLAGS="$moo_ac_save_CPPFLAGS"
MOO_XML_PKG_NAME=libxml-2.0