com gtk/php-gtk: I believe this should resolve the circular include problem.: ext/gtk+/config.m4 ext/gtk+/php_gtk+.h ext/libg lade/Makefile.frag
generator/generator.php main/php_g tk_api.h
| From: | David Soria Parra | Date: | Thu, 06 Oct 2005 07:03:14 +0000 |
| Subject: | com gtk/php-gtk: I believe this should resolve the circular include problem.: ext/gtk+/config.m4 ext/gtk+/php_gtk+.h ext/libg lade/Makefile.frag generator/generator.php main/php_g tk_api.h |
||
| Groups: | php.gtk.cvs | ||
| Request: | Send a blank email to php-gtk-cvs+get-4776@lists.php.net to get a copy of this message | ||
Commit: 8543e48464fec6713c29917e4a7f299afebad9e7
Author: Andrei Zmievski <andrei@php.net> Thu, 6 Oct 2005 07:03:14 +0000
Parents: 9a11e72e3e24d246d815847eec6acb829dd9738e
Branches: master
Link: http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=8543e48464fec6713c29917e4a7f299afebad9e7
Log:
I believe this should resolve the circular include problem.
Changed paths:
M ext/gtk+/config.m4
M ext/gtk+/php_gtk+.h
M ext/libglade/Makefile.frag
M generator/generator.php
A main/php_gtk_api.h
Diff:
8543e48464fec6713c29917e4a7f299afebad9e7
diff --git a/ext/gtk+/config.m4 b/ext/gtk+/config.m4
index e3480f5..7b55021 100644
--- a/ext/gtk+/config.m4
+++ b/ext/gtk+/config.m4
@@ -28,4 +28,4 @@ PHP_EVAL_LIBLINE($PANGO_LIBS, PHP_GTK2_SHARED_LIBADD)
PHP_SUBST(PHP_GTK2_SHARED_LIBADD)
-PHP_GTK_EXTENSION([gtk+], no, [gen_atk.c gen_pango.c gen_gdk.c gen_gtk.c php_gtk+.c
php_gtk+_types.c])
+PHP_GTK_EXTENSION([gtk+], no, [php_gtk+.c php_gtk+_types.c], [gen_atk.c gen_pango.c gen_gdk.c
gen_gtk.c])
diff --git a/ext/gtk+/php_gtk+.h b/ext/gtk+/php_gtk+.h
index d9ca51c..9e17ac7 100644
--- a/ext/gtk+/php_gtk+.h
+++ b/ext/gtk+/php_gtk+.h
@@ -49,8 +49,6 @@ void phpg_gtk_register_classes(void);
void php_gtk_plus_register_types();
-#include "gen_gtk.h"
-
#if 0
PHP_GTK_API extern int le_gtk_object;
PHP_GTK_API extern int le_php_gtk_wrapper;
diff --git a/ext/libglade/Makefile.frag b/ext/libglade/Makefile.frag
index d375d96..7eb4e19 100644
--- a/ext/libglade/Makefile.frag
+++ b/ext/libglade/Makefile.frag
@@ -1,9 +1,14 @@
-$(builddir)/php_libglade.lo: $(builddir)/gen_ce_libglade.h
-
$(builddir)/gen_libglade.c: $(srcdir)/libglade.defs $(srcdir)/libglade.overrides
- $(PHP) -f $(top_srcdir)/generator/generator.php -- -o $(srcdir)/libglade.overrides -p libglade -r
$(top_srcdir)/ext/gtk%2b/gtk.defs $(srcdir)/libglade.defs > $@
-
-$(builddir)/gen_ce_libglade.h: $(builddir)/gen_libglade.c
- grep -h "^PHP_GTK_EXPORT_CE" $(srcdir)/gen_libglade.c | sed -e "s!^!extern !"
> $@
-
+ ( \
+ $(PHP) $(top_srcdir)/generator/generator.php \
+ -l $(@D)/gen_$(*F).log \
+ -r ext/gtk+/atk-types.defs \
+ -r ext/gtk+/pango-types.defs \
+ -r ext/gtk+/gdk-types.defs \
+ -r ext/gtk+/gtk-types.defs \
+ -o ext/libglade/libglade.overrides \
+ -p Glade \
+ -f $@ ext/libglade/libglade.defs \
+ && grep -h "^PHP_GTK_EXPORT_CE" $@ | sed -e "s!^!extern !" >
$(@D)/gen_$(*F).h \
+ )
diff --git a/generator/generator.php b/generator/generator.php
index 71a14a8..5f7ec45 100644
--- a/generator/generator.php
+++ b/generator/generator.php
@@ -909,7 +909,8 @@ class Generator {
$this->log_print($this->make_header("$this->prefix Summary"));
$this->fp = new LineOutput(fopen($savefile, 'w'), $savefile);
- $this->fp->write("#include \"php_gtk.h\"");
+ $this->fp->write("#include \"php_gtk.h\"\n");
+ $this->fp->write("#include \"php_gtk_api.h\"\n");
$this->fp->write("\n#if HAVE_PHP_GTK\n");
$this->fp->write($this->overrides->get_headers());
$this->write_class_entries();
diff --git a/main/php_gtk_api.h b/main/php_gtk_api.h
new file mode 100644
index 0000000..57c0990
--- /dev/null
+++ b/main/php_gtk_api.h
@@ -0,0 +1,4 @@
+#include "ext/gtk+/gen_gtk.h"
+#include "ext/gtk+/gen_gdk.h"
+#include "ext/gtk+/gen_atk.h"
+#include "ext/gtk+/gen_pango.h"