Code

Clean up internal Python/Perl dialog text; link against the python dynamic library
authorkeescook <keescook@users.sourceforge.net>
Sat, 16 Dec 2006 04:30:23 +0000 (04:30 +0000)
committerkeescook <keescook@users.sourceforge.net>
Sat, 16 Dec 2006 04:30:23 +0000 (04:30 +0000)
configure.ac
src/ui/dialog/scriptdialog.cpp

index e4bed1609968a5b319ac89c3899360089b879b1c..61d5a8d1ccf43b2ed0e35b8e0e433746f78cda1f 100644 (file)
@@ -406,7 +406,7 @@ if test "x$with_python" = "xyes"; then
     if test "$?" -gt "0"; then
         with_python="no"
     else
-        checkPYTHON_LIBS=`python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LIBRARY'),distutils.sysconfig.get_config_var('LIBS'))" 2>/dev/null`
+        checkPYTHON_LIBS=`python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'),distutils.sysconfig.get_config_var('LIBS'))" 2>/dev/null`
         if test "$?" -gt "0"; then
             with_python="no"
         else
@@ -860,11 +860,13 @@ Configuration:
         LDFLAGS:                  ${LDFLAGS}
 
         Use Xft font database:    ${xft_ok}
-       Use gnome-vfs:            ${gnome_vfs}
+        Use gnome-vfs:            ${gnome_vfs}
         Use openoffice files:     ${ij}
         Use MMX optimizations:    ${use_mmx_asm}
         Use relocation support:   ${enable_binreloc}
-       Enable LittleCms:         ${enable_lcms}
-       Enable Inkboard:          ${with_inkboard}
-       Enable SSL in Inkboard:   ${with_inkboard_ssl}
+        Internal Python:          ${with_python}
+        Internal Perl:            ${with_perl}
+        Enable LittleCms:         ${enable_lcms}
+        Enable Inkboard:          ${with_inkboard}
+        Enable SSL in Inkboard:   ${with_inkboard_ssl}
 "
index 8cc8f88aa9920cc546a60f299ddcf53cecc31093..a8c0286d68f3cfcaa41182306c75be5c58a8dfdf 100644 (file)
@@ -98,6 +98,7 @@ class ScriptDialogImpl : public ScriptDialog
 };
 
 static char *defaultPythonCodeStr =
+#if defined(WITH_PYTHON)
     "# This is a sample Python script.\n"
     "# To run it, select 'Execute Python' from the File menu above.\n"
     "desktop = inkscape.getDesktop()\n"
@@ -105,6 +106,21 @@ static char *defaultPythonCodeStr =
     "document = desktop.getDocument()\n"
     "document.hello()\n"
     "dialogmanager.showAbout()\n"
+#elif defined(WITH_PERL)
+    "# This is a sample Perl script.\n"
+    "# To run it, select 'Execute Perl' from the File menu above.\n"
+    "my $desktop = $inkscape->getDesktop();\n"
+    "my $dialogmanager = $inkscape->getDialogManager();\n"
+    "my $document = $desktop->getDocument();\n"
+    "$document->hello();\n"
+    "$dialogmanager->showAbout();\n"
+#else
+    "# This is where you could type a script.\n"
+    "# However, no scripting languages have been compiled\n"
+    "# into Inkscape, so this window has no functionality.\n"
+    "# When compiling Inkscape, run \"configure\" with\n"
+    "# \"--with-python\" and/or \"--with-perl\".\n"
+#endif
     "";
 
 
@@ -178,10 +194,14 @@ ScriptDialogImpl::ScriptDialogImpl()
     menuBar.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_File"), fileMenu) );
     fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Clear"),
            sigc::mem_fun(*this, &ScriptDialogImpl::clear) ) );
+#ifdef WITH_PYTHON
     fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Execute Python"),
            sigc::mem_fun(*this, &ScriptDialogImpl::executePython) ) );
+#endif
+#ifdef WITH_PERL
     fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Execute Perl"),
            sigc::mem_fun(*this, &ScriptDialogImpl::executePerl) ) );
+#endif
     mainVBox->pack_start(menuBar, Gtk::PACK_SHRINK);
 
     //### Set up the script field