~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/b2/b26b0eef352b87ecaa1dc79f0bbac27abaab9677.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
#
 
3
# Starts the GNU Java interpreter.
 
4
#
 
5
# Command-line arguments should be in the style of Sun's Java runtime;
 
6
# these will be converted to gij arguments before being passed to the
 
7
# gij itself.
 
8
#
 
9
# The Debian JNI module directory and any other specified JNI
 
10
# directories will be included on the JNI search path.
 
11
#
 
12
# Copyright (C) 2002-2003 by Ben Burton <bab@debian.org>
 
13
# Based on the original gij-wrapper-3.2 shell script.
 
14
 
 
15
use strict;
 
16
 
 
17
# The real Java runtime:
 
18
my $javaRuntime = '/usr/bin/gij-@BV@';
 
19
 
 
20
# The debian JNI module directory:
 
21
my $debianJNIDir = '/usr/lib/jni';
 
22
 
 
23
# The command-line arguments to pass to the real Java runtime:
 
24
my @commandLine;
 
25
 
 
26
# The full JNI search path to use:
 
27
my $JNIPath = '';
 
28
 
 
29
# Build the command-line from the arguments given.
 
30
my $parsingOptions = 1;
 
31
 
 
32
# Flag used to copy argument to -classpath or -cp.
 
33
my $copyNext = 0;
 
34
foreach my $arg (@ARGV) {
 
35
  if (not $parsingOptions) {
 
36
    # We're done parsing options; just copy all remaining arguments directly.
 
37
    push @commandLine, $arg;
 
38
    next;
 
39
  }
 
40
  if ($copyNext) {
 
41
    push @commandLine, $arg;
 
42
    $copyNext = 0;
 
43
    next;
 
44
  }
 
45
 
 
46
  # Try to interpret Sun-style options.
 
47
  if ($arg eq '-version') {
 
48
    push @commandLine, '--version';
 
49
  } elsif ($arg eq '-h' or $arg eq '-help') {
 
50
    push @commandLine, '--help';
 
51
  } elsif ($arg eq '-cp' or $arg eq '--cp') {
 
52
    push @commandLine, '-cp';
 
53
    $copyNext = 1;
 
54
  } elsif ($arg eq '-classpath' or $arg eq '--classpath') {
 
55
    push @commandLine, '-classpath';
 
56
    $copyNext = 1;
 
57
  } elsif ($arg =~ /^-Djava.library.path=(.+)$/) {
 
58
    # A component of the JNI search path has been given.
 
59
    if ($JNIPath) {
 
60
      $JNIPath = $JNIPath . ':' . $1;
 
61
    } else {
 
62
      $JNIPath = $1;
 
63
    }
 
64
  } elsif ($arg eq '-jar' or $arg =~ /^-D/) {
 
65
    # Copy the argument directly.
 
66
    push @commandLine, $arg;
 
67
  } elsif ($arg =~ /^-/) {
 
68
    # An unrecognised option has been passed - just drop it.
 
69
  } else {
 
70
    # Some non-option argument has been given.
 
71
    # Stop parsing options at this point.
 
72
    push @commandLine, $arg;
 
73
    $parsingOptions = 0;
 
74
  }
 
75
}
 
76
 
 
77
# Add the debian JNI module directory to the JNI search path if it's not
 
78
# already there.
 
79
if ($JNIPath !~ /(^|:)$debianJNIDir($|:)/) {
 
80
  if ($JNIPath) {
 
81
    $JNIPath = $JNIPath . ':' . $debianJNIDir;
 
82
  } else {
 
83
    $JNIPath = $debianJNIDir;
 
84
  }
 
85
}
 
86
 
 
87
# Use environment variable $LTDL_LIBRARY_PATH to store the JNI path,
 
88
# since gij uses libltdl to dlopen JNI modules.
 
89
if ($ENV{LTDL_LIBRARY_PATH}) {
 
90
    $ENV{LTDL_LIBRARY_PATH} = $ENV{LTDL_LIBRARY_PATH} . ':' . $JNIPath;
 
91
} else {
 
92
    $ENV{LTDL_LIBRARY_PATH} = $JNIPath;
 
93
}
 
94
 
 
95
# Call the real Java runtime.
 
96
my @fullCommandLine = ( $javaRuntime );
 
97
push @fullCommandLine, @commandLine;
 
98
exec @fullCommandLine or exit(1);