Made it more ggap-friendly

This commit is contained in:
Yevgen Muntyan 2007-05-08 09:01:44 -05:00
parent 00b0265f74
commit 6c9d7005af
12 changed files with 43 additions and 158 deletions

View File

@ -10,6 +10,8 @@ echo "srcdir=" $srcdir
if test -d $rel_srcdir/m4 ; then
aclocal_extra="-I m4"
elif test -d $rel_srcdir/moo/m4 ; then
aclocal_extra="-I moo/m4"
fi
cd $srcdir

View File

@ -24,7 +24,7 @@ ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
MOO_SRC_PREFIX="moo"
AC_SUBST(MOO_SRC_PREFIX)
MOO_COMPONENTS([app,edit,term],[])
MOO_AC_SET_DIRS(moo)
MOO_AC_SET_DIRS
MOO_AC_FLAGS(moo)

View File

@ -59,4 +59,9 @@ AC_DEFUN([MOO_COMPONENTS],[
if test "x$MOO_OS_BSD" = "xyes"; then
$build_mooterm && MOO_LIBS="-lutil $MOO_LIBS"
fi
AC_ARG_ENABLE(project,
AC_HELP_STRING(--enable-project, [enable project plugin (default = NO)]),
[:],[enable_project=no])
AM_CONDITIONAL(MOO_ENABLE_PROJECT, test "x$enable_project" = xyes)
])

View File

@ -90,9 +90,9 @@ m4_undefine([_moo_WNAME])
if $_MOO_GCC; then
if test "x$_moo_all_warnings" = "xyes"; then
_MOO_AC_CHECK_COMPILER_OPTIONS(MOO_CFLAGS,[-fstrict-aliasing])
_MOO_AC_CHECK_COMPILER_OPTIONS(MOO_DEBUG_CFLAGS,[-fstrict-aliasing])
else
_MOO_AC_CHECK_COMPILER_OPTIONS(MOO_CFLAGS,[-fno-strict-aliasing])
_MOO_AC_CHECK_COMPILER_OPTIONS(MOO_DEBUG_CFLAGS,[-fno-strict-aliasing])
fi
fi

View File

@ -1,26 +1,29 @@
##############################################################################
# MOO_AC_SET_DIRS(base)
# MOO_AC_SET_DIRS
#
AC_DEFUN_ONCE([MOO_AC_SET_DIRS],[
MOO_PACKAGE_NAME=$1
AC_SUBST(MOO_PACKAGE_NAME)
AC_DEFINE([MOO_PACKAGE_NAME], "$1", [package name])
if test "x$MOO_PACKAGE_NAME" = x; then
MOO_PACKAGE_NAME=moo
fi
MOO_DATA_DIR="${datadir}/$1"
AC_SUBST(MOO_DATA_DIR)
AC_SUBST(MOO_PACKAGE_NAME)
AC_DEFINE_UNQUOTED([MOO_PACKAGE_NAME], "$MOO_PACKAGE_NAME", [package name])
MOO_LIB_DIR="${libdir}/$1"
AC_SUBST(MOO_LIB_DIR)
MOO_DATA_DIR="${datadir}/$MOO_PACKAGE_NAME"
AC_SUBST(MOO_DATA_DIR)
mimedir="${datadir}/mime"
AC_SUBST(mimedir)
MOO_LIB_DIR="${libdir}/$MOO_PACKAGE_NAME"
AC_SUBST(MOO_LIB_DIR)
MOO_PLUGINS_DIR="${MOO_LIB_DIR}/plugins"
AC_SUBST(MOO_PLUGINS_DIR)
mimedir="${datadir}/mime"
AC_SUBST(mimedir)
MOO_TEXT_LANG_FILES_DIR="${MOO_DATA_DIR}/language-specs"
AC_SUBST(MOO_TEXT_LANG_FILES_DIR)
MOO_PLUGINS_DIR="${MOO_LIB_DIR}/plugins"
AC_SUBST(MOO_PLUGINS_DIR)
moo_includedir=${includedir}/$1
AC_SUBST(moo_includedir)
MOO_TEXT_LANG_FILES_DIR="${MOO_DATA_DIR}/language-specs"
AC_SUBST(MOO_TEXT_LANG_FILES_DIR)
moo_includedir=${includedir}/$MOO_PACKAGE_NAME
AC_SUBST(moo_includedir)
])

View File

@ -1,5 +1,5 @@
##############################################################################
# MOO_DEFINE_VERSIONS(pkg,major,minor,micro)
# MOO_DEFINE_VERSIONS(pkg,version)
#
AC_DEFUN([MOO_DEFINE_VERSIONS],[
_MOO_SPLIT_VERSION([m4_toupper($1)], [$2])

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<medit-project version="1.0" type="C" name="moo">
<active>optimized</active>
<active>debug</active>
<configurations>
<debug>
<build_dir>build/debug</build_dir>
<configure>
<args>--enable-debug=full --enable-all-warnings --enable-libmoo --with-mooterm --enable-libmoo-headers</args>
<args>--enable-debug=full --enable-all-warnings --enable-libmoo --with-mooterm --enable-libmoo-headers --enable-project</args>
<vars>
<var name="CFLAGS">-g</var>
</vars>

View File

@ -1,4 +1,9 @@
SUBDIRS = pyproject
DIST_SUBDIRS = pyproject
SUBDIRS = .
if MOO_ENABLE_PROJECT
SUBDIRS += pyproject
endif
moopython_pluginsdir = ${MOO_PLUGINS_DIR}
plugins_libdir = ${MOO_PLUGINS_DIR}/lib

View File

@ -54,7 +54,6 @@ mooutils_include_headers = \
mooprefsdialog.h \
mooprefsdialogpage.h \
moopython.h \
mooregex.h \
moostock.h \
moouixml.h \
mooundo.h \
@ -117,7 +116,6 @@ mooutils_sources = \
mooprefsdialog.c \
mooprefsdialogpage.c \
moopython.c \
mooregex.c \
moospawn.h \
moospawn.c \
moostock.c \

View File

@ -1,64 +0,0 @@
/*
* mooregex.c
*
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* See COPYING file that comes with this distribution.
*/
#include "mooutils/mooregex.h"
#include "mooutils/eggregex.h"
MooRegex *
moo_regex_new (const gchar *pattern,
MooRegexCompileFlags compile_options,
MooRegexMatchFlags match_options,
GError **error)
{
EggRegex *regex;
regex = egg_regex_new (pattern, compile_options, match_options, error);
if (regex)
egg_regex_optimize (regex, NULL);
return (MooRegex*) regex;
}
void
moo_regex_free (MooRegex *regex)
{
egg_regex_free ((EggRegex*) regex);
}
void
moo_regex_clear (MooRegex *regex)
{
egg_regex_clear ((EggRegex*) regex);
}
gboolean
moo_regex_match (MooRegex *regex,
const char *string,
MooRegexMatchFlags match_options)
{
return egg_regex_match ((EggRegex*) regex, string, match_options);
}
gchar *
moo_regex_fetch (MooRegex *regex,
int match_num,
const char *string)
{
return egg_regex_fetch ((EggRegex*) regex, match_num, string);
}

View File

@ -1,69 +0,0 @@
/*
* mooregex.h
*
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* See COPYING file that comes with this distribution.
*/
#ifndef MOO_REGEX_H
#define MOO_REGEX_H
#include <glib.h>
G_BEGIN_DECLS
typedef enum
{
MOO_REGEX_CASELESS = 1 << 0,
MOO_REGEX_MULTILINE = 1 << 1,
MOO_REGEX_DOTALL = 1 << 2,
MOO_REGEX_EXTENDED = 1 << 3,
MOO_REGEX_ANCHORED = 1 << 4,
MOO_REGEX_DOLLAR_ENDONLY = 1 << 5,
MOO_REGEX_UNGREEDY = 1 << 9,
MOO_REGEX_RAW = 1 << 11,
MOO_REGEX_NO_AUTO_CAPTURE = 1 << 12,
MOO_REGEX_DUPNAMES = 1 << 19,
MOO_REGEX_NEWLINE_CR = 1 << 20,
MOO_REGEX_NEWLINE_CRLF = 1 << 21 | MOO_REGEX_NEWLINE_CR
} MooRegexCompileFlags;
typedef enum
{
MOO_REGEX_MATCH_ANCHORED = 1 << 4,
MOO_REGEX_MATCH_NOTBOL = 1 << 7,
MOO_REGEX_MATCH_NOTEOL = 1 << 8,
MOO_REGEX_MATCH_NOTEMPTY = 1 << 10,
MOO_REGEX_MATCH_PARTIAL = 1 << 15,
MOO_REGEX_MATCH_NEWLINE_CR = 1 << 20,
MOO_REGEX_MATCH_NEWLINE_LF = 1 << 21,
MOO_REGEX_MATCH_NEWLINE_CRLF = MOO_REGEX_MATCH_NEWLINE_CR | MOO_REGEX_MATCH_NEWLINE_LF
} MooRegexMatchFlags;
typedef struct _MooRegex MooRegex;
MooRegex *moo_regex_new (const char *pattern,
MooRegexCompileFlags compile_options,
MooRegexMatchFlags match_options,
GError **error);
void moo_regex_free (MooRegex *regex);
void moo_regex_clear (MooRegex *regex);
gboolean moo_regex_match (MooRegex *regex,
const char *string,
MooRegexMatchFlags match_options);
gchar *moo_regex_fetch (MooRegex *regex,
int match_num,
const char *string);
G_END_DECLS
#endif /* MOO_REGEX_H */

View File

@ -93,6 +93,11 @@ const char *_xdg_get_base_name (const char *file_name);
int _xdg_mime_buffer_is_text (unsigned char *buffer,
int len);
#undef malloc
#undef realloc
#undef free
#undef strdup
#undef calloc
#define malloc g_try_malloc
#define realloc g_try_realloc
#define free g_free