Partially ported to automake
This commit is contained in:
Родитель
1372fd796d
Коммит
c8a301545d
|
@ -1,34 +0,0 @@
|
|||
MAIGRE_SOURCES = \
|
||||
Cairo/ColorExtensions.cs \
|
||||
Cairo/ContextExtensions.cs \
|
||||
Cairo/Corner.cs \
|
||||
Cairo/RectangleExtensions.cs \
|
||||
Maigre.Osx/OsxTheme.cs \
|
||||
Maigre/Theme.cs \
|
||||
Maigre/Theme_Generated.cs
|
||||
|
||||
MAIGRE_OTHER = gtkrc
|
||||
|
||||
REFERENCES = \
|
||||
Mono.Cairo \
|
||||
-pkg:gtk-sharp-2.0 \
|
||||
System \
|
||||
System.Core
|
||||
|
||||
REFERENCES_BUILD = \
|
||||
$(filter -pkg:%, $(REFERENCES)) \
|
||||
$(foreach r, $(filter-out -pkg:%, $(REFERENCES)), -r:$(r))
|
||||
|
||||
all: Maigre.dll
|
||||
|
||||
Maigre.dll: $(MAIGRE_SOURCES)
|
||||
gmcs -out:$@ -target:library -debug $(REFERENCES_BUILD) $(MAIGRE_SOURCES)
|
||||
|
||||
Maigre/Theme_Generated.cs: ../maigre-codegen/maigre-codegen.py
|
||||
$(MAKE) -C ../maigre-codegen
|
||||
|
||||
run:
|
||||
$(MAKE) -C .. run
|
||||
|
||||
clean:
|
||||
rm -rf Maigre.dll* obj/ Maigre/Theme_Generated.cs
|
|
@ -0,0 +1,18 @@
|
|||
SUBDIRS = \
|
||||
libmaigre
|
||||
|
||||
EXTRA_DIST = \
|
||||
Maigre.sln
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
Makefile.in \
|
||||
INSTALL \
|
||||
aclocal.m4 \
|
||||
config.guess \
|
||||
config.sub \
|
||||
configure \
|
||||
depcomp \
|
||||
install-sh \
|
||||
ltmain.sh \
|
||||
missing \
|
||||
mkinstalldirs
|
15
Makefile.in
15
Makefile.in
|
@ -1,15 +0,0 @@
|
|||
all:
|
||||
$(MAKE) -C libmaigre
|
||||
$(MAKE) -C Maigre
|
||||
|
||||
clean:
|
||||
$(MAKE) -C libmaigre clean
|
||||
$(MAKE) -C Maigre clean
|
||||
rm -rf lib
|
||||
|
||||
run:
|
||||
rm -rf lib
|
||||
mkdir -p lib/engines
|
||||
cp Maigre/gtkrc lib
|
||||
cp libmaigre/libmaigre.so Maigre/Maigre.dll lib/engines
|
||||
GTK_PATH=$$PWD/lib GTK2_RC_FILES=lib/gtkrc gtk-demo
|
|
@ -0,0 +1,76 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PROJECT=maigre
|
||||
|
||||
function error () {
|
||||
echo "Error: $1" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function check_autotool_version () {
|
||||
which $1 &>/dev/null || {
|
||||
error "$1 is not installed, and is required to configure $PACKAGE"
|
||||
}
|
||||
|
||||
version=$($1 --version | head -n 1 | cut -f4 -d' ')
|
||||
major=$(echo $version | cut -f1 -d.)
|
||||
minor=$(echo $version | cut -f2 -d.)
|
||||
rev=$(echo $version | cut -f3 -d. | sed 's/[^0-9].*$//')
|
||||
major_check=$(echo $2 | cut -f1 -d.)
|
||||
minor_check=$(echo $2 | cut -f2 -d.)
|
||||
rev_check=$(echo $2 | cut -f3 -d.)
|
||||
|
||||
if [ $major -lt $major_check ]; then
|
||||
do_bail=yes
|
||||
elif [[ $minor -lt $minor_check && $major = $major_check ]]; then
|
||||
do_bail=yes
|
||||
elif [[ $rev -lt $rev_check && $minor = $minor_check && $major = $major_check ]]; then
|
||||
do_bail=yes
|
||||
fi
|
||||
|
||||
if [ x"$do_bail" = x"yes" ]; then
|
||||
error "$1 version $2 or better is required to configure $PROJECT"
|
||||
fi
|
||||
}
|
||||
|
||||
function run () {
|
||||
echo "Running $@ ..."
|
||||
$@ 2>.autogen.log || {
|
||||
cat .autogen.log 1>&2
|
||||
rm .autogen.log
|
||||
error "Could not run $1, which is required to configure $PROJECT"
|
||||
}
|
||||
rm .autogen.log
|
||||
}
|
||||
|
||||
srcdir=$(dirname $0)
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
(test -f $srcdir/configure.ac) || {
|
||||
error "Directory \"$srcdir\" does not look like the top-level $PROJECT directory"
|
||||
}
|
||||
|
||||
check_autotool_version aclocal 1.9
|
||||
check_autotool_version automake 1.9
|
||||
check_autotool_version autoconf 2.53
|
||||
check_autotool_version libtoolize 1.4.3
|
||||
check_autotool_version pkg-config 0.14.0
|
||||
|
||||
run libtoolize --force --copy --automake
|
||||
run aclocal $ACLOCAL_FLAGS
|
||||
run autoconf
|
||||
|
||||
test -f config.h.in && touch config.h.in
|
||||
run automake --gnu --add-missing --force --copy \
|
||||
-Wno-portability -Wno-portability
|
||||
|
||||
if [ ! -z "$NOCONFIGURE" ]; then
|
||||
echo "Done. ./configure skipped."
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
echo "WARNING: I am going to run configure without any arguments."
|
||||
fi
|
||||
|
||||
run ./configure --enable-maintainer-mode $@
|
|
@ -1,76 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
function check_start {
|
||||
echo -n "Checking for $1... "
|
||||
}
|
||||
|
||||
function check_fail {
|
||||
echo no
|
||||
echo
|
||||
echo "$1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function check_success {
|
||||
echo yes
|
||||
}
|
||||
|
||||
check_start "GTK+"
|
||||
pkg-config --atleast-version 2.12 gtk+-2.0 ||
|
||||
check_fail "Please install gtk+-2.0 >= 2.12" &&
|
||||
check_success
|
||||
|
||||
check_start "Mono runtime"
|
||||
pkg-config --atleast-version 2.6 mono ||
|
||||
check_fail "Please install mono-devel >= 2.6" &&
|
||||
check_success
|
||||
|
||||
check_start "gmcs compiler"
|
||||
gmcs --help &>/dev/null ||
|
||||
check_fail "Please install gmcs" &&
|
||||
check_success
|
||||
|
||||
check_start "Gtk#"
|
||||
pkg-config --atleast-version 2.12 gtk-sharp-2.0 ||
|
||||
check_fail "Please install gtk-sharp-2.0 >= 2.12" &&
|
||||
check_success
|
||||
|
||||
check_start "gcc"
|
||||
gcc --help &>/dev/null ||
|
||||
check_fail "Please install gcc" &&
|
||||
check_success
|
||||
|
||||
check_start "Python runtime"
|
||||
python --help &>/dev/null ||
|
||||
check_fail "Please install python" &&
|
||||
check_success
|
||||
|
||||
check_start "Python mako module"
|
||||
python -c 'import mako' &>/dev/null ||
|
||||
check_fail "Please install python-mako." &&
|
||||
check_success
|
||||
|
||||
function generate {
|
||||
echo "Created $1"
|
||||
packages="mono gtk+-2.0"
|
||||
sed \
|
||||
"s,@PKG_CFLAGS@,$(pkg-config --cflags $packages),g;
|
||||
s,@PKG_LIBS@,$(pkg-config --libs $packages),g" \
|
||||
< $1.in \
|
||||
> $1
|
||||
{ cat <<EOF
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile
|
||||
EOF
|
||||
} >> $1
|
||||
}
|
||||
|
||||
generate Makefile
|
||||
generate libmaigre/Makefile
|
||||
generate Maigre/Makefile
|
||||
|
||||
echo
|
||||
echo "Success. You may now run make."
|
|
@ -0,0 +1,44 @@
|
|||
AC_PREREQ(2.52)
|
||||
AC_INIT([maigre], [0.1])
|
||||
AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar foreign])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
AM_DISABLE_STATIC
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_PATH_PROG(MCS, gmcs)
|
||||
if test x$MCS = x; then
|
||||
AC_MSG_ERROR([Could not find 'gmcs'])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(MONO, mono)
|
||||
if test x$MONO = x; then
|
||||
AC_MSG_ERROR([Could not find 'mono'])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(PYTHON, python)
|
||||
if test x$PYTHON = x; then
|
||||
AC_MSG_ERROR([Could not find 'python'])
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0 >= 2.12)
|
||||
|
||||
PKG_CHECK_MODULES(MONO, mono >= 2.6)
|
||||
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.12)
|
||||
|
||||
GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
|
||||
AC_SUBST(GTK_VERSION)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
libmaigre/Makefile
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
|
@ -0,0 +1,26 @@
|
|||
EXTRA_DIST = maigre-style.c.in
|
||||
CLEANFILES = maigre-style.c
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
INCLUDES = \
|
||||
-Wall -ggdb3 -D_FORTIFY_SOURCE=2 \
|
||||
$(MONO_CFLAGS) \
|
||||
$(GTK_CFLAGS)
|
||||
|
||||
MAIGRE_SRC = \
|
||||
maigre-mono-bridge.c \
|
||||
maigre-mono-bridge.h \
|
||||
maigre-rc-style.c \
|
||||
maigre-rc-style.h \
|
||||
maigre-style.h \
|
||||
maigre-theme-module.c
|
||||
|
||||
enginedir = $(libdir)/gtk-2.0/$(GTK_VERSION)/engines
|
||||
engine_LTLIBRARIES = libmaigre.la
|
||||
|
||||
libmaigre_la_SOURCES = $(MAIGRE_SRC) maigre-style.c
|
||||
libmurrine_la_LDFLAGS = -module -avoid-version -no-undefined
|
||||
libmurrine_la_LIBADD = $(MONO_LIBS) $(GTK_LIBS)
|
||||
|
||||
maigre-style.c: maigre-style.c.in
|
||||
@echo " GEN $@"; ../maigre-codegen/maigre-codegen.py $< $@
|
|
@ -1,30 +0,0 @@
|
|||
LIBMAIGRE_SOURCES = \
|
||||
maigre-mono-bridge.c \
|
||||
maigre-rc-style.c \
|
||||
maigre-style.c \
|
||||
maigre-theme-module.c
|
||||
|
||||
LIBMAIGRE_OTHER = \
|
||||
maigre-mono-bridge.h \
|
||||
maigre-rc-style.h \
|
||||
maigre-style.h
|
||||
|
||||
CC = gcc
|
||||
LIBMAIGRE_CFLAGS = -Wall -O2 -ggdb3 @PKG_CFLAGS@ $(CFLAGS)
|
||||
LIBMAIGRE_LDFLAGS = -shared @PKG_LIBS@ $(LDFLAGS)
|
||||
LIBMAIGRE_OBJECTS = $(LIBMAIGRE_SOURCES:.c=.o)
|
||||
|
||||
all: libmaigre.so
|
||||
|
||||
libmaigre.so: codegen $(LIBMAIGRE_OBJECTS)
|
||||
$(CC) $(LIBMAIGRE_LDFLAGS) $(LIBMAIGRE_OBJECTS) -o $@
|
||||
|
||||
codegen: ../maigre-codegen/maigre-codegen.py
|
||||
./$<
|
||||
touch maigre-style.c
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(LIBMAIGRE_CFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf $(LIBMAIGRE_OBJECTS) libmaigre.so maigre-style-overrides.c
|
|
@ -1,55 +0,0 @@
|
|||
//
|
||||
// maigre-style.c
|
||||
//
|
||||
// Author:
|
||||
// Aaron Bockover <abockover@novell.com>
|
||||
//
|
||||
// Copyright 2010 Novell, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "maigre-style.h"
|
||||
#include "maigre-mono-bridge.h"
|
||||
|
||||
typedef void (* DrawFnptr) ();
|
||||
|
||||
struct MaigreStyle {
|
||||
GtkStyle parent_instance;
|
||||
};
|
||||
|
||||
struct MaigreStyleClass {
|
||||
GtkStyleClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (MaigreStyle, maigre_style, GTK_TYPE_STYLE);
|
||||
|
||||
#include "maigre-style-overrides.c"
|
||||
|
||||
static void
|
||||
maigre_style_init (MaigreStyle *maigre)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
maigre_style_class_init (MaigreStyleClass *klass)
|
||||
{
|
||||
maigre_style_override_methods (GTK_STYLE_CLASS (klass));
|
||||
}
|
|
@ -202,8 +202,6 @@ parser = GtkStyleHeaderParser ()
|
|||
parser.blacklist = ['draw_polygon']
|
||||
parser.parse ()
|
||||
|
||||
print sys.argv[2]
|
||||
|
||||
generator = CodeGenerator (parser)
|
||||
result = generator.generate (sys.argv[1])
|
||||
with open (sys.argv[2], 'w') as out:
|
||||
|
|
Загрузка…
Ссылка в новой задаче