]> granicus.if.org Git - graphviz/commitdiff
Pass demand_loading flag into libgvc similar to builtins
authorellson <devnull@localhost>
Wed, 25 Feb 2009 17:46:45 +0000 (17:46 +0000)
committerellson <devnull@localhost>
Wed, 25 Feb 2009 17:46:45 +0000 (17:46 +0000)
cmd/dot/Makefile.am
cmd/dot/dot.c
cmd/dot/no_demand_loading.c [deleted file]
cmd/tools/Makefile.am
cmd/tools/gvpack.c
configure.ac
lib/gvc/Makefile.am
lib/gvc/demand_loading.c [deleted file]
lib/gvc/dot_builtins.c [deleted file]
lib/gvc/gvc.c
lib/gvc/no_demand_loading.c [deleted file]

index f52465f2b325baf8ce648e93299d22a2c387c15b..a80c469704d9c8adee0cf16035f02093cbb82b48 100644 (file)
@@ -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 \
index 79a05aae700d0086b0977eabe21772ceb448590f..39c58424139d6b6ac5949575e1eea5a03ba10894 100644 (file)
@@ -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 (file)
index 7490a02..0000000
+++ /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;
index 986d50b24026e62259f9bc9187be6ca44aa511c0..8d42f8b5c54a6f6b5e7ff91e6a801ab5b0edd50b 100644 (file)
@@ -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 \
index 76b2f3322c94ba857b0c03282cb7d65ebdd2416f..ded297adfd0e765570836b4e143a6d102de516b6 100644 (file)
@@ -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);
index 5f89ce429344e80ca2bfaf520a6a433afe11fe40..d29445d7ac18c84183cbc6bd25acbadb8df18679 100644 (file)
@@ -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)
index 9d70e6b1c6ddac0fb0d8f61d6bc03ea81cb61ee1..e77da64966720196314ce24c8f80de4980f0280b 100644 (file)
@@ -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 (file)
index 77f85e6..0000000
+++ /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 (file)
index 6f9b29b..0000000
+++ /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 
index 753f1549d50c66a019f44499008539ec153222f2..a6b2b6837fa7bf5c8f6c0bc16ace69376114d15f 100644 (file)
@@ -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 (file)
index 7490a02..0000000
+++ /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;