From cc46d1fba15f4ece7c65d7d19973ba79c792c368 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 4 Sep 2004 00:24:40 +0000 Subject: [PATCH] Blurb about using SWIG in build systems added git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6222 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Doc/Manual/Contents.html | 1 + SWIG/Doc/Manual/Introduction.html | 41 +++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/SWIG/Doc/Manual/Contents.html b/SWIG/Doc/Manual/Contents.html index eca81a89c..e52a02aba 100644 --- a/SWIG/Doc/Manual/Contents.html +++ b/SWIG/Doc/Manual/Contents.html @@ -41,6 +41,7 @@
  • Supported C/C++ language features
  • Non-intrusive interface building +
  • Incorporating SWIG into a build system
  • Hands off code generation
  • SWIG and freedom diff --git a/SWIG/Doc/Manual/Introduction.html b/SWIG/Doc/Manual/Introduction.html index acdeb4c00..7474028e7 100644 --- a/SWIG/Doc/Manual/Introduction.html +++ b/SWIG/Doc/Manual/Introduction.html @@ -20,6 +20,7 @@
  • Supported C/C++ language features
  • Non-intrusive interface building +
  • Incorporating SWIG into a build system
  • Hands off code generation
  • SWIG and freedom @@ -323,26 +324,52 @@ stresses the very limits of many C++ compilers. When used as intended, SWIG requires minimal (if any) modification to -existing C code. This makes SWIG extremely easy to use with existing +existing C or C++ code. This makes SWIG extremely easy to use with existing packages and promotes software reuse and modularity. By making -the C code independent of the high level interface, you can change the +the C/C++ code independent of the high level interface, you can change the interface and reuse the code in other applications. It is also possible to support different types of interfaces depending on the application. -

    2.6 Hands off code generation

    +

    2.6 Incorporating SWIG into a build system

    + + +

    +SWIG is a command line tool and as such can be incorporated into any build system that supports invoking external tools/compilers. +SWIG is most commonly invoked from within a Makefile, but is also known to be invoked from from popular IDEs such as +Microsoft Visual Studio. +

    + +

    +There is growing support for SWIG in some build tools, for example CMake +is a cross-platform, open-source build tool with built in support for SWIG. It can detect the SWIG executable, +many of the target language interpreters and libraries for linking against. +It can then use this information to generate a makefile/project file for a host of different compilers/IDEs. +

    + +

    +If you are using the GNU Autotools +(Autoconf/ +Automake/ +Libtool) +to configure SWIG use in your project, the SWIG Autoconf macros can be used. +The primary macro is ac_pkg_swig, see +http://www.gnu.org/software/ac-archive/htmldoc/ac_pkg_swig.html. +The ac_python_devel Autoconf macro is also helpful for SWIG generated Python interfaces, see the +Autoconf Macro Archive for further information and other . +

    + +

    2.7 Hands off code generation

    SWIG is designed to produce working code that needs no hand-modification (in fact, if you look at the output, you probably -won't want to modify it). Ideally, SWIG should be invoked -automatically inside a Makefile just as one would call the C -compiler. You should think of your scripting language interface being +won't want to modify it). You should think of your target language interface being defined entirely by the input to SWIG, not the resulting output file. While this approach may limit flexibility for hard-core hackers, it allows others to forget about the low-level implementation details. -

    2.7 SWIG and freedom

    +

    2.8 SWIG and freedom

    No, this isn't a special section on the sorry state of world politics.