summaryrefslogtreecommitdiff
path: root/lib/javacomp.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* sh-quote, execute, spawn-pipe, etc.: Make better use of 'const'.Bruno Haible2020-12-121-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/sh-quote.h (shell_quote_argv): Does not need write access to the elements of argv. * lib/sh-quote.c (shell_quote_argv): Likewise. * lib/windows-spawn.h (prepare_spawn): Add 'const' the argument type and the return type. * lib/windows-spawn.c (prepare_spawn): Likewise. * lib/os2-spawn.h (prepare_spawn): Likewise. * lib/os2-spawn.c (prepare_spawn): Likewise. * lib/execute.h (execute): Does not need write access to the elements of prog_argv. * lib/execute.c (execute): Likewise. * lib/spawn-pipe.h (create_pipe_out, create_pipe_in, create_pipe_bidi): Likewise. * lib/spawn-pipe.c (create_pipe, create_pipe_bidi, create_pipe_in, create_pipe_out): Likewise. * lib/pipe-filter.h (pipe_filter_ii_execute, pipe_filter_gi_create): Likewise. * lib/pipe-filter-ii.c (pipe_filter_ii_execute): Likewise. * lib/pipe-filter-gi.c (pipe_filter_gi_create): Likewise. * lib/javaexec.h (execute_fn): Does not need write access to the elements of prog_argv. * lib/javaexec.c (execute_java_class): Update variable types and remove casts to 'char *'. * lib/csharpexec.h (execute_fn): Does not need write access to the elements of prog_argv. * lib/csharpexec.c (execute_csharp_using_mono, execute_csharp_using_sscli): Update variable types and remove casts to 'char *'. * lib/javacomp.c (compile_using_envjavac, compile_using_gcj, compile_using_javac, compile_using_jikes, is_envjavac_gcj, is_envjavac_gcj43, is_gcj_present, is_gcj_43, is_javac_present, is_jikes_present): Update variable types and remove casts to 'char *'. * lib/javaversion.c (execute_and_read_line): Does not need write access to the elements of prog_argv. * lib/csharpcomp.c (compile_csharp_using_mono, compile_csharp_using_sscli): Update variable types and remove casts to 'char *'. * tests/test-sh-quote.c (main): Update variable types and remove casts to 'char *'. * tests/test-execute-main.c (main): Update variable types and remove casts to 'char *'. * tests/test-spawn-pipe-main.c (test_pipe): Update variable types and remove casts to 'char *'. * NEWS: Mention the changes.
* spawn-pipe: Allow caller to specify directory for the subprocess.Bruno Haible2020-12-021-8/+8
| | | | | | | | | | | | | | | | | | | | | | * lib/spawn-pipe.h (create_pipe_out, create_pipe_in, create_pipe_bidi): Add directory argument. * lib/spawn-pipe.c: Include canonicalize.h, filename.h, findprog.h. (create_pipe): Add directory argument. If specified, resolve the program file name and make it absolute, first. Pass the directory to spawnpvech and posix_spawn_file_actions_addchdir. (create_pipe_bidi, create_pipe_in, create_pipe_out): Add directory argument. * modules/spawn-pipe (Depends-on): Add canonicalize, filename, findprog-in, posix_spawn, posix_spawn_file_actions_addchdir. * tests/test-spawn-pipe-main.c (test_pipe): Update. * NEWS: Mention the change. * lib/csharpcomp.c (compile_csharp_using_mono, compile_csharp_using_sscli): Update. * lib/javacomp.c (is_envjavac_gcj, is_envjavac_gcj43, is_gcj_present, is_gcj_43): Update. * lib/javaversion.c (execute_and_read_line): Update. * lib/pipe-filter-gi.c (pipe_filter_gi_create): Update. * lib/pipe-filter-ii.c (pipe_filter_ii_execute): Update.
* execute: Allow caller to specify directory for the subprocess.Bruno Haible2020-12-021-8/+14
| | | | | | | | | | | | | | | | | | | | | | * lib/execute.h (execute): Add directory argument. * lib/execute.c: Include canonicalize.h, filename.h, findprog.h. (execute): Add directory argument. If specified, resolve the program file name and make it absolute, first. Pass the directory to spawnpvech and posix_spawn_file_actions_addchdir. * modules/execute (Depends-on): Add canonicalize, filename, findprog-in, posix_spawn, posix_spawn_file_actions_addchdir. * tests/test-execute-main.c: Add test for passing a directory. * tests/test-execute-child.c: Likewise. * tests/test-execute.sh: Update. * modules/execute-tests (Depends-on): Add mkdir. * NEWS: Mention the change. * lib/csharpcomp.c (compile_csharp_using_sscli): Update. * lib/csharpexec.c (execute_csharp_using_mono, execute_csharp_using_sscli): Update. * lib/javacomp.c (compile_using_envjavac, compile_using_gcj, compile_using_javac, compile_using_jikes, is_javac_present, is_jikes_present): Update. * lib/javaexec.c (execute_java_class): Update.
* clean-temp: Don't force deletion of temporary files on native Windows.Bruno Haible2020-06-281-1/+1
| | | | | | | | * lib/clean-temp.h (open_temp, fopen_temp): Add delete_on_close argument. * lib/clean-temp.c (open_temp, fopen_temp): Likewise. * NEWS: Mention the change. * lib/javacomp.c (write_temp_file): Update.
* javacomp: Make more robust in multithreaded applications.Bruno Haible2020-05-281-1/+1
| | | | | | * lib/javacomp.c (get_classfile_version): Pass an O_CLOEXEC flag to open(). * modules/javacomp (Depends-on): Add 'open'.
* javacomp: Make more robust in multithreaded applications.Bruno Haible2020-05-271-1/+1
| | | | | * lib/javacomp.c (write_temp_file): Pass an 'e' flag to fopen_temp. * modules/javacomp (Depends-on): Add fopen-gnu.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* sh-filename: New module.Bruno Haible2018-10-051-6/+6
| | | | | | | | | | | | | | | | * m4/sh-filename.m4: New file. * modules/sh-filename: New file. * lib/spawni.c (_PATH_BSHELL): Use BOURNE_SHELL instead of hardcoding "/bin/sh". * tests/test-posix_spawn1.c (main): Likewise. * tests/test-posix_spawn2.c (main): Likewise. * lib/javacomp.c (compile_using_envjavac, is_envjavac_gcj, is_envjavac_gcj43): Likewise. * lib/javaexec.c (execute_java_class): Likewise. * modules/posix_spawn-internal (Depends-on): Add sh-filename. * modules/posix_spawnp-tests (Depends-on): Likewise. * modules/javacomp (Depends-on): Likewise. * modules/javaexec (Depends-on): Likewise.
* javacomp-script, javacomp: Add preliminary support for Java 12..17.Bruno Haible2018-09-261-3/+14
| | | | | * m4/javacomp.m4 (gt_JAVACOMP): Treat Java versions 12..17 like 11. * lib/javacomp.c (default_target_version): Likewise.
* javacomp-script, javacomp: Add support for Java 11.Bruno Haible2018-09-261-7/+16
| | | | | | | | | | | | * m4/javacomp.m4 (gt_JAVACOMP): Accept source-version 11 and target-version 11. * lib/javaversion.h: Update comments. * lib/javacomp.c (default_target_version, SOURCE_VERSION_BOUND, source_version_index, get_goodcode_snippet, get_failcode_snippet, TARGET_VERSION_BOUND, target_version_index, corresponding_classfile_version): Accept source_version 11 and target_version 11. * lib/javacomp.h: Update comments accordingly.
* javacomp-script, javacomp: Add support for Java 10.Bruno Haible2018-03-241-3/+18
| | | | | | | | | | | | * m4/javacomp.m4 (gt_JAVACOMP): Accept source-version 10 and target-version 10. * lib/javaversion.h: Update comments. * lib/javacomp.c (default_target_version, SOURCE_VERSION_BOUND, source_version_index, get_goodcode_snippet, get_failcode_snippet, TARGET_VERSION_BOUND, target_version_index, corresponding_classfile_version): Accept source_version 10 and target_version 10. * lib/javacomp.h: Update comments accordingly.
* javacomp-script, javacomp: Fix support for Java 7, 8, 9.Bruno Haible2018-03-241-34/+71
| | | | | | | | | | | | | | | | | | * lib/javaversion.h: Update comments. * lib/javacomp.h: Likewise. * lib/javacomp.c (default_target_version, source_version_index, get_goodcode_snippet, get_failcode_snippet): Recognize "9" instead of "1.9". (TARGET_VERSION_BOUND): Bump to 9. (target_version_index, corresponding_classfile_version): Recognize "9" instead of "1.9". (get_source_version_for_javac): New function. (is_envjavac_nongcj_usable, is_javac_usable): Add source_version_for_javac argument. (compile_java_class): Determine and pass source_version_for_javac. * m4/javacomp.m4: Recognize version '9' instead of '1.9'. When invoking $JAVAC or javac, pass '-source 1.6' instead of '-source 1.5' when appropriate.
* javacomp: Add support for Java 7, 8, 9.Bruno Haible2018-03-201-6/+29
| | | | | | | | * lib/javacomp.c (default_target_version, SOURCE_VERSION_BOUND, source_version_index, get_goodcode_snippet, get_failcode_snippet, corresponding_classfile_version): Accept source_version 1,7, 1.8, 1.9 and target_version 1,7, 1.8, 1.9. * lib/javacomp.h: Update comments accordingly.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* javacomp: Fix handle leak.Bruno Haible2017-05-161-1/+4
| | | | | | Found by Coverity. * lib/javacomp.c (get_classfile_version): Close fd before returning.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* fchdir: port 'open' and 'close' redefinitions to AIX 7.1Paul Eggert2014-05-221-5/+0
| | | | | | | | | | | | | | | * lib/chown.c, lib/clean-temp.c, lib/copy-file.c, lib/execute.c: * lib/fsusage.c, lib/gc-gnulib.c, lib/javacomp.c, lib/mountlist.c: * lib/openat-proc.c, lib/pagealign_alloc.c, lib/progreloc.c: * lib/spawn-pipe.c: Do not #undef 'open' and 'close'. AIX 7 does '#define open open64' and then 'int open64(const char *, int, ...);', which means the declaration for 'open' gets lost if we later '#undef open'. Discovered while building grep pretest 2.18.151-1c770 on AIX 7.1, where the compilation reported the non-fatal error "In function 'openat_proc_name' ... warning: implicit declaration of function 'open'". In this case the error is relatively harmless, but in other cases it might not be so minor.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* Rename module 'pipe' to 'spawn-pipe'.Bruno Haible2010-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/spawn-pipe: New file, renamed from modules/pipe. (Files, configure.ac, Makefile.am): Update. (Include): Mention "spawn-pipe.h" instead of "pipe.h". * modules/pipe: Reduce to an obsolete indirection to 'spawn-pipe'. * lib/spawn-pipe.h: New file, renamed from lib/pipe.h. * lib/spawn-pipe.c: New file, renamed from lib/pipe.c. Include "spawn-pipe.h" instead of "pipe.h". * m4/spawn-pipe.m4: New file, renamed from m4/pipe.m4. Rename gl_PIPE to gl_SPAWN_PIPE. * modules/spawn-pipe-tests: New file, renamed from modules/pipe-tests. (Files, Makefile.am): Update. * tests/test-spawn-pipe.sh: New file, renamed from tests/test-pipe.sh. Update. * tests/test-spawn-pipe.c: New file, renamed from tests/test-pipe.c. Include "spawn-pipe.h" instead of "pipe.h". * lib/csharpcomp.c: Include "spawn-pipe.h" instead of "pipe.h". * lib/javacomp.c: Likewise. * lib/javaversion.c: Likewise. * lib/pipe-filter-gi.c: Likewise. * lib/pipe-filter-ii.c: Likewise. * modules/csharpcomp (Depends-on): Add 'spawn-pipe', remove 'pipe'. * modules/javacomp (Depends-on): Likewise. * modules/javaversion (Depends-on): Likewise. * modules/pipe-filter-gi (Depends-on): Likewise. * modules/pipe-filter-ii (Depends-on): Likewise. * MODULES.html.sh (Executing programs): Update. * NEWS: Mention the change.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* update nearly all FSF copyright year lists to include 2009Jim Meyering2009-12-291-1/+1
| | | | | | | | | | | | | | | | | | The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-1142/+1142
|
* New module 'xconcat-filename', split off from module 'concat-filename'.Bruno Haible2008-09-021-62/+62
|
* Add termsigp argument to execute() and wait_process().Bruno Haible2008-06-101-11/+13
|
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* Move getline and getdelim into stdio.h, per POSIX 200x.Eric Blake2007-08-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/getline (Files): Remove getline.h. (Depends-on): Add stdio. (configure.ac): Add module indicator. * modules/getdelim (Files): Remove getdelim.h. (Depends-on): Add stdio. (configure.ac): Add module indicator. * modules/stdio (Makefile.am): Work with new indicators. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Add new defaults. * m4/getdelim.m4 (gl_FUNC_GETDELIM): Work with stdio needs. * m4/getline.m4 (gl_FUNC_GETLINE): Likewise. * lib/getdelim.h: Delete. * lib/getline.h: Delete. * lib/stdio_.h (getdelim, getline): Declare. * modules/getdelim-tests: New module. * modules/getline-tests: Likewise. * tests/test-getdelim.c: New file. * tests/test-getline.c: Likewise. * NEWS: Document the change. * lib/getline.c: Update choice of header. * lib/csharpcomp.c: Likewise. * lib/getpass.c: Likewise. * lib/javacomp.c: Likewise. * lib/javaversion.c: Likewise. * lib/yesno.c: Likewise. * lib/getdelim.c: Likewise. (getdelim): Set errno on failure, and avoid memory leak.
* Update after allocsa -> malloca renaming.Bruno Haible2007-06-091-17/+17
|
* Rename module 'pathname' to 'filename'.Bruno Haible2007-02-251-34/+34
| | | | Rename concatenated_pathname to concatenated_filename.
* Make use of gcj-4.3's -fsource and -ftarget option.Bruno Haible2007-02-041-41/+582
|
* Small optimization.Bruno Haible2007-01-271-2/+5
|
* * doc/gnulib-tool.texi (Initial import): Update to match currentPaul Eggert2007-01-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior with strdup module. * lib/.cppi-disable: Remove strcase.h, strdup.h, strndup.h, strnlen.h. * lib/memmem.h: Remove; all uses removed. This is now done by <string.h>. * lib/mempcpy.h: Likewise. * lib/memrchr.h: Likewise. * lib/stpcpy.h: Likewise. * lib/stpncpy.h: Likewise. * lib/strcase.h: Likewise. * lib/strchrnul.h: Likewise. * lib/strdup.h: Likewise. * lib/strndup.h: Likewise. * lib/strnlen.h: Likewise. * lib/strpbrk.h: Likewise. * lib/strsep.h: Likewise. * lib/strstr.h: Likewise. * lib/strtok_r.h: Likewise. * lib/string_.h: New file. * lib/argp-namefrob.h: Don't include no-longer-existent include files. Rely on <string.h> instead. * lib/canon-host.c: Likewise. * lib/chdir-long.c: Likewise. * lib/concatpath.c: Likewise. * lib/exclude.c: Likewise. * lib/fchdir.c: Likewise. * lib/getaddrinfo.c: Likewise. * lib/getcwd.c: Likewise. * lib/getsubopt.c: Likewise. * lib/glob.c: Likewise. * lib/hard-locale.c: Likewise. * lib/iconvme.c: Likewise. * lib/javacomp.c: Likewise. * lib/mempcpy.c: Likewise. * lib/memrchr.c: Likewise. * lib/regex_internal.h: Likewise. * lib/stpncpy.c: Likewise. * lib/strcasecmp.c: Likewise. * lib/strchrnul.c: Likewise. * lib/strdup.c: Likewise. * lib/striconv.c: Likewise. * lib/striconveh.c: Likewise. * lib/striconveha.c: Likewise. * lib/strncasecmp.c: Likewise. * lib/strndup.c: Likewise. * lib/strnlen.c: Likewise. * lib/strsep.c: Likewise. * lib/strstr.c: Likewise. * lib/strtok_r.c: Likewise. * lib/userspec.c: Likewise. * lib/w32spawn.h: Likewise. * lib/xstrndup.c: Likewise. * lib/mountlist.c (strstr): Remove decl. * m4/string_h.m4: New file. * m4/memmem.m4 (gl_FUNC_MEMMEM): Set HAVE_DECL_MEMMEM if necessary. * m4/mempcpy.m4 (gl_FUNC_MEMPCPY): Set HAVE_MEMPCPY if necessary. * m4/memrchr.m4 (gl_FUNC_MEMRCHR): Set HAVE_MEMRCHR * m4/stpcpy.m4 (gl_FUNC_STPCPY): Set HAVE_STPCPY if necessary. * m4/stpncpy.m4 (gl_PREREQ_STPNCPY): Set HAVE_STPNCPY if necessary. * m4/strcase.m4 (gl_FUNC_STRCASECMP): Set REPLACE_STRCASECMP if necessary. (gl_FUNC_STRNCASECMP): Set HAVE_DECL_STRNCASECMP if necessary. * m4/strchrnul.m4 (gl_FUNC_STRCHRNUL): Set HAVE_STRCHRNUL if necessary. * m4/strdup.m4 (gl_FUNC_STRDUP): Set HAVE_DECL_STRDUP if necessary. * m4/strndup.m4 (gl_FUNC_STRNDUP): Set HAVE_DECL_STRNLEN and HAVE_DECL_STRDUP if necessary. (gl_PREREQ_STRNLEN): Don't bother to check for strnlen decl, since gl_FUNC_STRNDUP does that now. * m4/strnlen.m4 (gl_FUNC_STRNLEN): Set HAVE_DECL_STRNLEN if necessary. Check for decl here... (gl_PREREQ_STRNLEN): ... not here. * m4/strpbrk.m4 (gl_FUNC_STRPBRK): Set HAVE_STRPBRK if necessary. * m4/strsep.m4 (gl_FUNC_STRSEP): Set HAVE_STRSEP if necessary. * m4/strstr.m4 (gl_FUNC_STRSTR): Set REPLACE_STRSTR if necessary. * m4/strtok_r.m4 (gl_FUNC_STRTOK_R): Set HAVE_DECL_STRTOK_R if necessary. * modules/string: New file. * modules/memmem (Files): Remove special-purpose include file. (Depends-on): Add string. (Include): Include <string.h>, not the removed file. * modules/mempcpy: Likewise. * modules/memrchr: Likewise. * modules/stpcpy: Likewise. * modules/stpncpy: Likewise. * modules/strcase: Likewise. * modules/strchrnul: Likewise. * modules/strdup: Likewise. * modules/strndup: Likewise. * modules/strnlen: Likewise. * modules/strpbrk: Likewise. * modules/strsep: Likewise. * modules/strstr: Likewise. * modules/strtok_r: Likewise. * tests/test-dirname.c: Don't include "stdup.h", since <string.h> now suffices. * tests/test-memmem.c: Don't include "memmem.h", since <string.h> now suffices.
* New module 'fchdir'.Bruno Haible2007-01-141-0/+5
|
* Ensure temp file is closed before its directory is removed.Bruno Haible2006-10-061-2/+2
|
* Include <config.h> unconditionally.Bruno Haible2006-09-141-3/+1
|
* Update from GNU gettext 0.15. Accept source and target versions.Bruno Haible2006-07-221-344/+1674
|
* * lib/argp-pv.c: Remove a doubled word in a comment.Jim Meyering2006-07-091-2/+2
| | | | | | * lib/check-version.c (check_version): Likewise. * lib/javacomp.c (compile_java_class): Likewise. * m4/glob.m4: Likewise.
* * lib/wait-process.c, lib/wait-process.h, lib/csharpcomp.c,Derek R. Price2006-04-261-1/+1
| | | | lib/execute.c, lib/javacomp.c: Back out previous change.
* * lib/wait-process.h (wait_subprocess): Accept a new exitsignal argument.Derek R. Price2006-04-251-1/+1
| | | | | | | * lib/wait-process.c (wait_subprocess): Always set *exitsignal to 0 when present and set it to the offending signal when the child exits due to a signal. * lib/csharpcomp.c, lib/execute.c, lib/javacomp.c: Update all callers.
* *** empty log message ***Paul Eggert2005-05-141-1/+1
|
* New module 'javacomp'.Bruno Haible2005-01-281-0/+479