Version simplification.

'swig -ldflags' added for MzScheme, Ocaml, Pike and PHP


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4187 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2002-12-11 22:39:28 +00:00
commit d489112eb9
5 changed files with 55 additions and 28 deletions

View file

@ -12,9 +12,12 @@
char cvsroot_java_cxx[] = "$Header$";
#include <ctype.h>
#include <limits.h> // for INT_MAX
#include "swigmod.h"
#ifndef MACSWIG
#include "swigconfig.h"
#endif
#include <ctype.h>
class JAVA : public Language {
static const char *usage;
@ -414,7 +417,7 @@ class JAVA : public Language {
void emitBanner(File *f) {
Printf(f, "/* ----------------------------------------------------------------------------\n");
Printf(f, " * This file was automatically generated by SWIG (http://www.swig.org).\n");
Printf(f, " * Version: %s\n", SWIG_VERSION);
Printf(f, " * Version: %s\n", PACKAGE_VERSION);
Printf(f, " *\n");
Printf(f, " * Do not make changes to this file unless you know what you are doing--modify\n");
Printf(f, " * the SWIG interface file instead.\n");
@ -1895,6 +1898,7 @@ swig_java(void) {
const char *JAVA::usage = (char*)"\
Java Options (available with -java)\n\
-package <name> - set name of the Java package\n\
-noproxy - Generate the low-level functional interface instead of proxy classes\n";
-noproxy - Generate the low-level functional interface instead of proxy classes\n\
\n";

View file

@ -25,14 +25,18 @@ char cvsroot_mzscheme_cxx[] = "$Header$";
#include "swigmod.h"
#ifndef MACSWIG
#include "swigconfig.h"
#endif
#include <ctype.h>
static const char *mzscheme_usage = (char*)"\
static const char *usage = (char*)"\
\n\
Mzscheme Options (available with -mzscheme)\n\
-help - Print this help\n\
-prefix name - Set a prefix to be appended to all names\n\
-declaremodule - Create extension that declares a module\n\
-ldflags - Print runtime libraries to link with\n\
-prefix name - Set a prefix to be appended to all names\n\
-declaremodule - Create extension that declares a module\n\
\n"
;
@ -64,10 +68,9 @@ public:
for (i = 1; i < argc; i++) {
if (argv[i]) {
if (strcmp (argv[i], "-help") == 0) {
fputs (mzscheme_usage, stderr);
fputs (usage, stderr);
SWIG_exit (0);
}
else if (strcmp (argv[i], "-prefix") == 0) {
} else if (strcmp (argv[i], "-prefix") == 0) {
if (argv[i + 1]) {
prefix = new char[strlen(argv[i + 1]) + 2];
strcpy(prefix, argv[i + 1]);
@ -77,10 +80,12 @@ public:
} else {
Swig_arg_error();
}
}
else if (strcmp (argv[i], "-declaremodule") == 0) {
} else if (strcmp (argv[i], "-declaremodule") == 0) {
declaremodule = true;
Swig_mark_arg (i);
} else if (strcmp (argv[i], "-ldflags") == 0) {
printf("%s\n", SWIG_MZSCHEME_RUNTIME);
SWIG_exit (EXIT_SUCCESS);
}
}
}

View file

@ -21,13 +21,17 @@ char cvsroot_ocaml_cxx[] = "$Header$";
#include "swigmod.h"
#ifndef MACSWIG
#include "swigconfig.h"
#endif
#include <ctype.h>
static const char *ocaml_usage = (char*)"\
static const char *usage = (char*)"\
\n\
Ocaml Options (available with -ocaml)\n\
-help - Print this help\n\
-prefix name - Set a prefix to be appended to all names\n\
-ldflags - Print runtime libraries to link with\n\
-prefix name - Set a prefix to be appended to all names\n\
\n";
static int classmode = 0;
@ -76,10 +80,9 @@ public:
for (i = 1; i < argc; i++) {
if (argv[i]) {
if (strcmp (argv[i], "-help") == 0) {
fputs (ocaml_usage, stderr);
fputs (usage, stderr);
SWIG_exit (0);
}
else if (strcmp (argv[i], "-prefix") == 0) {
} else if (strcmp (argv[i], "-prefix") == 0) {
if (argv[i + 1]) {
prefix = new char[strlen(argv[i + 1]) + 2];
strcpy(prefix, argv[i + 1]);
@ -89,6 +92,9 @@ public:
} else {
Swig_arg_error();
}
} else if (strcmp (argv[i], "-ldflags") == 0) {
printf("%s\n", SWIG_OCAML_RUNTIME);
SWIG_exit (EXIT_SUCCESS);
}
}
}

View file

@ -22,15 +22,17 @@ char cvsroot_php4_cxx[] = "$Header$";
static const char *usage = (char*)"\
PHP4 Options (available with -php4)\n\
-cppext - cpp file extension (default to .cpp)\n\
-proxy - Create proxy classes.\n\
-dlname name - Set module prefix.\n\
-make - Create simple makefile.\n\
-phpfull - Create full make files.\n\
-withincs libs - With -phpfull writes needed incs in config.m4\n\
-withlibs libs - With -phpfull writes needed libs in config.m4\n\n\
-withc libs - With -phpfull makes extra c files in Makefile.in\n\
-withcxx libs - With -phpfull makes extra c++ files in Makefile.in\n\n";
-ldflags - Print runtime libraries to link with\n\
-cppext - cpp file extension (default to .cpp)\n\
-proxy - Create proxy classes.\n\
-dlname name - Set module prefix.\n\
-make - Create simple makefile.\n\
-phpfull - Create full make files.\n\
-withincs libs - With -phpfull writes needed incs in config.m4\n\
-withlibs libs - With -phpfull writes needed libs in config.m4\n\n\
-withc libs - With -phpfull makes extra c files in Makefile.in\n\
-withcxx libs - With -phpfull makes extra c++ files in Makefile.in\n\
\n";
static int constructors=0;
static String *NOTCLASS=NewString("Not a class");
@ -308,6 +310,9 @@ public:
Swig_mark_arg(i);
} else if(strcmp(argv[i], "-help") == 0) {
fputs(usage, stderr);
} else if (strcmp (argv[i], "-ldflags") == 0) {
printf("%s\n", SWIG_PHP_RUNTIME);
SWIG_exit (EXIT_SUCCESS);
}
}
}

View file

@ -9,6 +9,11 @@ char cvsroot_pike_cxx[] = "$Header$";
#include "swigconfig.h"
#endif
static const char *usage = (char *)"\
Pike Options (available with -pike)\n\
-ldflags - Print runtime libraries to link with\n\
\n";
class PIKE : public Language {
private:
@ -62,7 +67,9 @@ public:
/* Look for certain command line options */
for (int i = 1; i < argc; i++) {
if (argv[i]) {
if (strcmp (argv[i], "-ldflags") == 0) {
if (strcmp(argv[i],"-help") == 0) {
fputs(usage,stderr);
} else if (strcmp (argv[i], "-ldflags") == 0) {
printf("%s\n", SWIG_PIKE_RUNTIME);
SWIG_exit(EXIT_SUCCESS);
}