From 098c947ef993557762edc2136a40619f9501b90f Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 25 Feb 2009 17:46:45 +0000 Subject: [PATCH] Pass demand_loading flag into libgvc similar to builtins --- cmd/dot/Makefile.am | 7 ++- cmd/dot/dot.c | 21 +------ cmd/dot/no_demand_loading.c | 17 ------ cmd/tools/Makefile.am | 1 + cmd/tools/gvpack.c | 2 +- configure.ac | 5 +- lib/gvc/Makefile.am | 5 +- lib/gvc/demand_loading.c | 33 ----------- lib/gvc/dot_builtins.c | 107 ------------------------------------ lib/gvc/gvc.c | 7 ++- lib/gvc/no_demand_loading.c | 17 ------ 11 files changed, 17 insertions(+), 205 deletions(-) delete mode 100644 cmd/dot/no_demand_loading.c delete mode 100644 lib/gvc/demand_loading.c delete mode 100644 lib/gvc/dot_builtins.c delete mode 100644 lib/gvc/no_demand_loading.c diff --git a/cmd/dot/Makefile.am b/cmd/dot/Makefile.am index f52465f2b..a80c46970 100644 --- a/cmd/dot/Makefile.am +++ b/cmd/dot/Makefile.am @@ -52,6 +52,7 @@ man_MANS = dot.1 pdf_DATA = dot.1.pdf dot_SOURCES = dot.c no_builtins.c +dot_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=1 dot_LDADD = $(top_builddir)/lib/gvc/libgvc.la install-data-hook: @@ -73,7 +74,8 @@ uninstall-hook: dot.1.pdf: $(srcdir)/dot.1 - $(GROFF) -Tps -man $(srcdir)/dot.1 | $(PS2PDF) - - >dot.1.pdf -dot_static_SOURCES = dot.c dot_builtins.c no_demand_loading.c +dot_static_SOURCES = dot.c dot_builtins.c +dot_static_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=0 dot_static_LDADD = \ $(top_builddir)/plugin/dot_layout/libgvplugin_dot_layout_C.la \ $(top_builddir)/plugin/neato_layout/libgvplugin_neato_layout_C.la \ @@ -84,7 +86,8 @@ dot_static_LDADD = \ $(top_builddir)/lib/cdt/libcdt_C.la \ $(GTS_LIBS) $(ICONV_LIBS) $(EXPAT_LIBS) $(Z_LIBS) $(LIBGEN_LIBS) $(SOCKET_LIBS) $(IPSEPCOLA_LIBS) $(MATH_LIBS) -dot_builtins_SOURCES = dot.c dot_builtins.c no_demand_loading.c +dot_builtins_SOURCES = dot.c dot_builtins.c +dot_builtins_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=1 dot_builtins_LDADD = \ $(top_builddir)/plugin/dot_layout/libgvplugin_dot_layout.la \ $(top_builddir)/plugin/neato_layout/libgvplugin_neato_layout.la \ diff --git a/cmd/dot/dot.c b/cmd/dot/dot.c index 79a05aae7..39c584241 100644 --- a/cmd/dot/dot.c +++ b/cmd/dot/dot.c @@ -167,26 +167,7 @@ int main(int argc, char **argv) #endif /* WITH_CGRAPH */ -#if 0 - -/* For Windows DLLs using builtins, we need to initialize - * * the lt_preloaded_symbols table. - * */ -/*visual studio*/ -#if defined(WIN32_DLL) && !defined(ENABLE_LTDL) - init_lt_preloaded_symbols(); -#endif -/*end visual studio*/ - -#ifndef WIN32_DLL -#if defined(GVDLL) && !defined(ENABLE_LTDL) - init_lt_preloaded_symbols(); -#endif -#endif - -#endif - - Gvc = gvNEWcontext(lt_preloaded_symbols); + Gvc = gvNEWcontext(lt_preloaded_symbols, DEMAND_LOADING); gvParseArgs(Gvc, argc, argv); #ifndef WIN32 diff --git a/cmd/dot/no_demand_loading.c b/cmd/dot/no_demand_loading.c deleted file mode 100644 index 7490a02b8..000000000 --- a/cmd/dot/no_demand_loading.c +++ /dev/null @@ -1,17 +0,0 @@ -/* $Id$ $Revision$ */ -/* vim:set shiftwidth=4 ts=8: */ - -/********************************************************** -* This software is part of the graphviz package * -* http://www.graphviz.org/ * -* * -* Copyright (c) 1994-2004 AT&T Corp. * -* and is licensed under the * -* Common Public License, Version 1.0 * -* by AT&T Corp. * -* * -* Information and Software Systems Research * -* AT&T Research, Florham Park NJ * -**********************************************************/ - -const int Demand_Loading = 0; diff --git a/cmd/tools/Makefile.am b/cmd/tools/Makefile.am index 986d50b24..8d42f8b5c 100644 --- a/cmd/tools/Makefile.am +++ b/cmd/tools/Makefile.am @@ -133,6 +133,7 @@ gc.1.pdf: $(srcdir)/gc.1 - @GROFF@ -Tps -man $(srcdir)/gc.1 | @PS2PDF@ - - >gc.1.pdf gvpack_SOURCES = gvpack.c gvpack_builtins.c +gvpack_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=0 gvpack_LDADD = \ $(top_builddir)/lib/gvc/libgvc.la \ diff --git a/cmd/tools/gvpack.c b/cmd/tools/gvpack.c index 76b2f3322..ded297adf 100644 --- a/cmd/tools/gvpack.c +++ b/cmd/tools/gvpack.c @@ -790,7 +790,7 @@ int main(int argc, char *argv[]) init(argc, argv); - gvc = gvNEWcontext(lt_preloaded_symbols); + gvc = gvNEWcontext(lt_preloaded_symbols, DEMAND_LOADING); gs = readGraphs(&cnt, gvc); if (cnt == 0) exit(0); diff --git a/configure.ac b/configure.ac index 5f89ce429..d29445d7a 100644 --- a/configure.ac +++ b/configure.ac @@ -266,7 +266,8 @@ fi dnl ----------------------------------- dnl checks for compilers -AC_PROG_CC +AM_PROG_CC_C_O +#AC_PROG_CC AC_PROG_CXX AC_PROG_OBJC @@ -990,7 +991,7 @@ else if test "x$use_swig" != "xYes"; then use_php="No (swig not available)" else - if test `$SWIG -help 2>&1 | $GREP -c '\-php *- Generate'` = 0 && `$SWIG -help 2>&1 | $GREP -c '\-php5 *- Generate'` = 0; then + if test `$SWIG -help 2>&1 | $GREP -c '\-php5* *- Generate'` = 0 ; then use_php="No (swig does not support -php or -php5 option)" else AC_CHECK_PROG(PHP,php,php) diff --git a/lib/gvc/Makefile.am b/lib/gvc/Makefile.am index 9d70e6b1c..e77da6496 100644 --- a/lib/gvc/Makefile.am +++ b/lib/gvc/Makefile.am @@ -30,8 +30,7 @@ LIBS = $(LIBLTDL) $(SOCKET_LIBS) $(Z_LIBS) $(MATH_LIBS) pkginclude_HEADERS = gvc.h gvcext.h gvplugin.h gvcjob.h \ gvcommon.h gvplugin_render.h gvplugin_layout.h gvconfig.h \ - gvplugin_textlayout.h gvplugin_device.h gvplugin_loadimage.h \ - demand_loading.c no_demand_loading.c + gvplugin_textlayout.h gvplugin_device.h gvplugin_loadimage.h noinst_HEADERS = gvcint.h gvcproc.h gvio.h noinst_LTLIBRARIES = libgvc_C.la lib_LTLIBRARIES = libgvc.la @@ -54,7 +53,7 @@ libgvc_C_la_DEPENDENCIES += $(top_builddir)/lib/ortho/libortho_C.la endif libgvc_la_LDFLAGS = -version-info $(GVC_VERSION) -no-undefined -libgvc_la_SOURCES = $(libgvc_C_la_SOURCES) demand_loading.c +libgvc_la_SOURCES = $(libgvc_C_la_SOURCES) libgvc_la_LIBADD = $(libgvc_C_la_LIBADD) \ $(top_builddir)/lib/cdt/libcdt.la \ $(top_builddir)/lib/$(GRAPH)/lib$(GRAPH).la \ diff --git a/lib/gvc/demand_loading.c b/lib/gvc/demand_loading.c deleted file mode 100644 index 77f85e639..000000000 --- a/lib/gvc/demand_loading.c +++ /dev/null @@ -1,33 +0,0 @@ -/* $Id$ $Revision$ */ -/* vim:set shiftwidth=4 ts=8: */ - -/********************************************************** -* This software is part of the graphviz package * -* http://www.graphviz.org/ * -* * -* Copyright (c) 1994-2004 AT&T Corp. * -* and is licensed under the * -* Common Public License, Version 1.0 * -* by AT&T Corp. * -* * -* Information and Software Systems Research * -* AT&T Research, Florham Park NJ * -**********************************************************/ - -/*visual studio*/ -#ifdef WIN32_DLL -#ifndef GVC_EXPORTS -__declspec(dllimport) int Demand_Loading = 1; -#else -__declspec(dllexport) int Demand_Loading = 1; -#endif -#endif -/*end visual studio*/ - -#ifndef WIN32_DLL -#ifdef GVDLL -__declspec(dllexport) int Demand_Loading = 1; -#else -const int Demand_Loading = 1; -#endif -#endif \ No newline at end of file diff --git a/lib/gvc/dot_builtins.c b/lib/gvc/dot_builtins.c deleted file mode 100644 index 6f9b29b3a..000000000 --- a/lib/gvc/dot_builtins.c +++ /dev/null @@ -1,107 +0,0 @@ -/* $Id$ $Revision$ */ -/* vim:set shiftwidth=4 ts=8: */ - -/********************************************************** -* This software is part of the graphviz package * -* http://www.graphviz.org/ * -* * -* Copyright (c) 1994-2004 AT&T Corp. * -* and is licensed under the * -* Common Public License, Version 1.0 * -* by AT&T Corp. * -* * -* Information and Software Systems Research * -* AT&T Research, Florham Park NJ * -**********************************************************/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "gvplugin.h" - -#if defined(GVDLL) && !defined(ENABLE_LTDL) -#define extern __declspec(dllimport) -#endif - -extern gvplugin_library_t gvplugin_dot_layout_LTX_library; -extern gvplugin_library_t gvplugin_neato_layout_LTX_library; -#ifdef HAVE_LIBGD -extern gvplugin_library_t gvplugin_gd_LTX_library; -#endif -#ifdef HAVE_PANGOCAIRO -extern gvplugin_library_t gvplugin_pango_LTX_library; -#endif -extern gvplugin_library_t gvplugin_core_LTX_library; - - -lt_symlist_t lt_preloaded_symbols[] = { - { "gvplugin_dot_layout_LTX_library", (void*)(&gvplugin_dot_layout_LTX_library) }, - { "gvplugin_neato_layout_LTX_library", (void*)(&gvplugin_neato_layout_LTX_library) }, -#ifdef HAVE_PANGOCAIRO - { "gvplugin_pango_LTX_library", (void*)(&gvplugin_pango_LTX_library) }, -#endif -#ifdef HAVE_LIBGD - { "gvplugin_gd_LTX_library", (void*)(&gvplugin_gd_LTX_library) }, -#endif - { "gvplugin_core_LTX_library", (void*)(&gvplugin_core_LTX_library) }, - { 0, 0 } -}; - - -#if 0 - -#if defined(GVDLL) && !defined(ENABLE_LTDL) -lt_symlist_t lt_preloaded_symbols[] = { - { "gvplugin_dot_layout_LTX_library", 0}, - { "gvplugin_neato_layout_LTX_library", 0}, -#ifdef HAVE_PANGOCAIRO - { "gvplugin_pango_LTX_library", 0}, -#endif -#ifdef HAVE_LIBGD - { "gvplugin_gd_LTX_library", 0}, -#endif - { "gvplugin_core_LTX_library", 0}, - { 0, 0 } -}; - -static void* -lt_lookup (const char* name) -{ - void* addr = 0; - switch (*(name + 9)) { /* skip "gvplugin_" */ - case 'c' : - addr = &gvplugin_core_LTX_library; - break; - case 'd' : - addr = &gvplugin_dot_layout_LTX_library; - break; -#ifdef HAVE_LIBGD - case 'g' : - addr = &gvplugin_gd_LTX_library; - break; -#endif - case 'n' : - addr = &gvplugin_neato_layout_LTX_library; - break; -#ifdef HAVE_PANGOCAIRO - case 'p' : - addr = &gvplugin_pango_LTX_library; - break; -#endif - } - return addr; -} - -void -init_lt_preloaded_symbols() -{ - const char* s; - int i; - for (i = 0; (s = lt_preloaded_symbols[i].name); i++) { - lt_preloaded_symbols[0].address = lt_lookup (s); - } -} - -#endif -#endif diff --git a/lib/gvc/gvc.c b/lib/gvc/gvc.c index 753f1549d..a6b2b6837 100644 --- a/lib/gvc/gvc.c +++ b/lib/gvc/gvc.c @@ -35,12 +35,13 @@ GVC_t *gvContext(void) #else agattr(NULL, AGNODE, "label", NODENAME_ESC); #endif - gvc = gvNEWcontext(NULL); + /* default to no builtins, demand loading enabled */ + gvc = gvNEWcontext(NULL, TRUE); gvconfig(gvc, FALSE); /* configure for available plugins and codegens */ return gvc; } -GVC_t *gvContextBuiltins(const lt_symlist_t *builtins) +GVC_t *gvContextPlugins(const lt_symlist_t *builtins, int demand_loading) { GVC_t *gvc; @@ -50,7 +51,7 @@ GVC_t *gvContextBuiltins(const lt_symlist_t *builtins) #else agattr(NULL, AGNODE, "label", NODENAME_ESC); #endif - gvc = gvNEWcontext(builtins); + gvc = gvNEWcontext(builtins, demand_loading); gvconfig(gvc, FALSE); /* configure for available plugins and codegens */ return gvc; } diff --git a/lib/gvc/no_demand_loading.c b/lib/gvc/no_demand_loading.c deleted file mode 100644 index 7490a02b8..000000000 --- a/lib/gvc/no_demand_loading.c +++ /dev/null @@ -1,17 +0,0 @@ -/* $Id$ $Revision$ */ -/* vim:set shiftwidth=4 ts=8: */ - -/********************************************************** -* This software is part of the graphviz package * -* http://www.graphviz.org/ * -* * -* Copyright (c) 1994-2004 AT&T Corp. * -* and is licensed under the * -* Common Public License, Version 1.0 * -* by AT&T Corp. * -* * -* Information and Software Systems Research * -* AT&T Research, Florham Park NJ * -**********************************************************/ - -const int Demand_Loading = 0; -- 2.40.0