summaryrefslogtreecommitdiffstats
path: root/configure
Commit message (Collapse)AuthorAgeFilesLines
* build: support linker flags/libs separation.Kaz Kylheku2021-01-141-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Our build system lumps all linker options together. The correct way is that linker flags are separated info flags and libs. Also, we respond to the LDFLAGS variable but ignore LDLIBS which is incorrect. Other issues are fixed. All that is fixed here. * Makefile (TXR_CFLAGS): Interpolate $(CFLAGS) last, so that options coming from CFLAGS can override previous options. (TXR_LDFLAGS): Interpolate $(LDFLAGS) last; same reason. (TXR_LDLIBS): New variable. (LINK_PROG): Put $(TXR_LDFLAGS) with the options, before the -o, and put $(TXR_LDLIBS) at the end. * configure (conf_ldlibs, platform_ldlibs): New variables. (usage text): Document platform-ldlibs and adjust documentation of platform-ldflags. (gen_config_make): Generate PLATFORM_LDLIBS and CONF_LDLIBS now needed by Makefile. (mainline): Adjusts various recipes to use conf_ldlibs instead of conf_ldflags, or in some cases both. In the case of libffi where we use pkg-config, we use the special pgk-config options to separately extract the flags and libs. We use EXTRA_LDLIBS instead of EXTRA_LDFLAGS in some conftest invocations, as necessary.
* Copyright year bump 2021.Kaz Kylheku2021-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * METALICENSE: 2020 copyrights bumped to 2021. Added note about SHA-256 routines from Colin Percival. * LICENSE, LICENSE-CYG, Makefile, alloca.h, args.c, args.h, arith.c, arith.h, buf.c, buf.h, cadr.c, cadr.h, chksum.c, chksum.h, chksums/crc32.c, chksums/crc32.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, ffi.c, ffi.h, filter.c, filter.h, ftw.c, ftw.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, itypes.c, itypes.h, jmp.S, lex.yy.c.shipped, lib.c, lib.h, linenoise/linenoise.c, linenoise/linenoise.h, lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, protsym.c, rand.c, rand.h, regex.c, regex.h, share/txr/stdlib/asm.tl, share/txr/stdlib/awk.tl, share/txr/stdlib/build.tl, share/txr/stdlib/cadr.tl, share/txr/stdlib/compiler.tl, share/txr/stdlib/conv.tl, share/txr/stdlib/copy-file.tl, share/txr/stdlib/debugger.tl, share/txr/stdlib/defset.tl, share/txr/stdlib/doloop.tl, share/txr/stdlib/each-prod.tl, share/txr/stdlib/error.tl, share/txr/stdlib/except.tl, share/txr/stdlib/ffi.tl, share/txr/stdlib/getopts.tl, share/txr/stdlib/getput.tl, share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl, share/txr/stdlib/keyparams.tl, share/txr/stdlib/op.tl, share/txr/stdlib/package.tl, share/txr/stdlib/param.tl, share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl, share/txr/stdlib/pmac.tl, share/txr/stdlib/quips.tl, share/txr/stdlib/save-exe.tl, share/txr/stdlib/socket.tl, share/txr/stdlib/stream-wrap.tl, share/txr/stdlib/struct.tl, share/txr/stdlib/tagbody.tl, share/txr/stdlib/termios.tl, share/txr/stdlib/trace.tl, share/txr/stdlib/txr-case.tl, share/txr/stdlib/type.tl, share/txr/stdlib/vm-param.tl, share/txr/stdlib/with-resources.tl, share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl, signal.c, signal.h, socket.c, socket.h, stream.c, stream.h, struct.c, struct.h, strudel.c, strudel.h, sysif.c, sysif.h, syslog.c, syslog.h, termios.c, termios.h, time.c, time.h, tree.c, tree.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h, vm.c, vm.h, vmop.h, win/cleansvg.txr, y.tab.c.shipped: Copyright year bumped to 2021.
* configure: tweak test for inline.Kaz Kylheku2021-01-041-3/+2
| | | | | | | | | | | | | | | | | | | | It seems that the Brew people are running into a problem. The configure test is detecting that "inline" can be used for declaring inline functions, but then some functions are not inlined, requiring an external definition. On GNU/Linuxes, we detect "static inline", so this doesn't reproduce. This is likely triggered by the recent change to compile as C99 (unless configuring in maintainer mode). * configure: Let's revise the set of possible definitions of INLINE that we try. Firstly, we only try "inline" if we are compiling as C++. If that fails, all the other forms of inline we try include "static". Let's not mess with anything involving "extern". Like a bare "inline", it might work in the test program but cause some sort of failure.
* Version 246txr-246Kaz Kylheku2020-12-311-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Version 245txr-245Kaz Kylheku2020-10-101-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. Fixed repeated word in documentation under env-hash. * share/txr/stdlib/ver.tl: Bumped from incorrect 243 value to 245.
* configure: don't disable PIE on Android.Kaz Kylheku2020-12-231-25/+29
| | | | | | | * configure: Move how-to-disable-PIE check below plaform detections, where we know whether we have Android or not. On Android, we can't disable PIE; non-PIE executables are not supported. Let's cross our fingers things work.
* build: Android support.Kaz Kylheku2020-12-231-0/+16
| | | | | | | | | | * Makefile (conftest.android): New helper target for testing for Android toolchain, via presence of __ANDROID__ preprocessor symbol, similarly to how we detect Darwin. * configure: New test for Android. This is mutually exclusive agains Darwin. On Android, we add some necessary feature selection macros to the compiler command line.
* configure: rename darwin variable.Kaz Kylheku2020-12-231-3/+3
| | | | * configure (need_darwin_c_source): Renamed to darwin_target.
* configure: get rid of -Wold-style-declarationKaz Kylheku2020-12-231-1/+1
| | | | | | | | * configure (diag_flags): Remove the -Wold-style-declaration option. It is not useful, unlike -Wold-style-definition; it warns agains some unspecified old style usages, like storage class specifiers not being first. Moreover, clang 10 does not recognize this option and complains.
* configure: relax to C99 for regular users.Kaz Kylheku2020-12-221-2/+9
| | | | | | | | | | | The code will continue to stick to C90, but requesting C90 compatibility from GCC may break for downstream users in some environments that don't support C90 in their header files. * configure (lang_flags): Remove -ansi option from here. (usage): Help text for maintainer mode updated. (mainline): Add -std=c++98 to the front of lang_flags if compiling as C++, -std=c90 in maintainer mode, else -std=c99.
* configure: C++ fix for recently added C flags.Kaz Kylheku2020-12-221-0/+1
| | | | | | | * configure: When we detect we are using C++, we filter out certain C-only compiler options. TO that list, we must add a pattern that gets rid of the recently added -Wold-style-definitions and -Wold-style-declarations.
* configure: C++ fix for type size detection case.Kaz Kylheku2020-12-221-4/+4
| | | | | | | | | | * configure: The new logic for detecting type sizes introduced in October, replacing the old nm-based trick, doesn't work with C++. An anonymous structure is being used to define an object with linkage: we fix that by giving the structure a tag name which be. C++ also doesn't like a one-character string literal like "\n" being used to initialize a char [1] array, so we make it [2].
* build: add more warnings against ancient C.Kaz Kylheku2020-12-131-1/+3
| | | | | | * configure (diag_flags): Add warning options agains defining an old style C function, and against obsolecent features in declarations.
* Version 244txr-244Kaz Kylheku2020-10-101-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* configure: replace nm-based trick for sizesKaz Kylheku2020-10-091-78/+62
| | | | | | | | | | | | | | | | | | | | | | | | The trick of declaring static arrays whose size is the value of an integer is not working with newer gcc 10 on Cygwin, because that compiler is rearranging the order of the arrays and adding padding. Basically, the writing on the wall is that this is not a good approach. I'm switching to a different approach. By initializing a suitable C structure (which contains character arrays) in a particular way, we can create a .o file in which a shell script is embedded. We can pull out the shell script and evaluate it to get the sizes of types. * Makefile (conftest.syms): Rule removed. (conftest.clean): Don't remove conftest.syms. * configure (conftest_syms, read_syms): Functions removed. (LANG, LC_ALL): New environment variables. This is needed because we are using tr to process a binary file; we can't have it trying to decode multi-byte characters. (mainline): Use new trick for obtaining variables like SIZEOF_INT.
* New function: time-nsec.Kaz Kylheku2020-10-071-0/+20
| | | | | | | | | | | | * configure: Test for clock_gettime, generating HAVE_CLOCK_GETTIME symbol in config.h. * time.c (time_sec_nsec): New function. (time_init): time-nsec intrinsic registered. * time.h (time_sec_nsec): Declared. * txr.1: Documented.
* configure: quote more characters in cmdlineKaz Kylheku2020-10-021-1/+1
| | | | | | | * configure: When calculating the cmdline variable from the positional parameters, there are more shell-special characters that require quoting: parentheses, braces, redirection operators, the semicolon and the hash comment.
* configure: only detect lex in maintainer mode.Kaz Kylheku2020-09-241-22/+30
| | | | | | | | | * Makefile (lex.yy.c): Move rule into maintainer conditional. * configure: Describe maintainer variable in help text. Move lex check into maintainer conditional. * lex.yy.c.shipped: New file.
* configure: detect yacc only in maintainer mode.Kaz Kylheku2020-09-241-40/+45
| | | | | | | | | | | * Makefile (YACC_FLAGS): Removed. We don't need these because we won't be trying to get newer Bison to behave like older Bison. (y.tab.c): Drop reference to $(YACC_FLAGS). * configure: Entire yacc-detecting section is conditional on the maintainer Boolean variable. If the yacc program is detected as Bison, check for version 2.5 and fail if not found.
* new: maintainer mode.Kaz Kylheku2020-09-241-0/+4
| | | | | | | | | | | | | | | | | | There is now a ./configure --maintainer mode which establishes a variable called maintainer in config.make, with a y value. The initial use for maintainer mode will be that the Yacc parser (the y.tab.c and y.tab.h) files will no longer be regenerated whenever the parser.y file is newer. In the following commit, I will add a generated parser. * Makefile (y.tab.h, y.tab.c): These rules are now only enabled in maintainer mode via an ifeq. * configure (maintainer): New variable. (gen_config_make): Generate maintainer make variable definition in config.make.
* Version 243txr-243Kaz Kylheku2020-09-011-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Version 242txr-242Kaz Kylheku2020-08-141-1/+1
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* Version 241txr-241Kaz Kylheku2020-08-071-1/+1
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated. * protsym.c: Likewise.
* New function strsignal.Kaz Kylheku2020-06-271-0/+19
| | | | | | | | | | * configure: detect strsignal, producing HAVE_STRSIGNAL symbol in config.h. * sysif.c (strsignal_wrap): New function. (sysif_init): Register strsignal intrinsic. * txr.1: Documented.
* New function: strerrorKaz Kylheku2020-06-191-0/+32
| | | | | | | | | | | | * configure (have_strerror_r): New variable. Detect whether we have strerror_r and which flavor: GNU or POSIX. Define HAVE_STRERROR_GNU or HAVE_STRERROR_POSIX in config.h. * sysif.c (strerror_wrap): New function. (sysif_init): Register strerror intrinsic. * txr.1: Documented.
* Version 240txr-240Kaz Kylheku2020-06-061-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* Version 239.txr-239Kaz Kylheku2020-06-021-1/+1
| | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise.
* streams: maintain integer format string detector.Kaz Kylheku2020-05-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * configure: provide LONGLONG_TYPE and INTPTR_TYPE macros in config.h that expand to a string literal capturing the original tokens of the type that was probed. * stream.c (struct fmt): Removed size member, replaced with type string. We can match format strings to the textual type, which will work even if we cannot compile that type. So that is to say, for instance the "%I64d" entry in the table is associated with "int64", whereas an expression like sizeof (int64) won't compile where that type doesn't exist. (fmt_tab): Replace sizes with type names. Also fix an issue: %llx was replicated in three rows of the table. (detect_format_string): Determine the textual type of cnum. It is a typedef for intptr_t, and the new INPTR_TYPE macro gives the tokens that were used to typedef intptr_t. If INTPTR_TYPE happens to be "longlong_t", we use LONGLONG_TYPE in its place. Then using the determined type, we can search the table for an appropriate entry: one which matches the type and whose conversion specifier works. Also, we now test all four conversion specifiers rather than assuming that if the decimal one is okay, the others work. Plus, if a working format string is not found, we now abort.
* Version 238.txr-238Kaz Kylheku2020-05-181-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* configure: --help doesn't clober ./reconfigureKaz Kylheku2020-05-081-15/+16
| | | | | * configure: move the section of the script which produces ./reconfigure after the help processing.
* Version 237.txr-237Kaz Kylheku2020-04-261-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* sockets: connect bugfix and use poll in preference to select.Kaz Kylheku2020-04-231-2/+2
| | | | | | | | | | | | | | | * configure: cosmetics: change HAVE_SYS_SELECT to HAVE_SELECT, and log that the function rather than the header is being detected. * socket.c (fd_timeout): New function, implemented using poll or select. (to_connect): select logic replaced with fd_timeout. Bug fixed: connect requires polling for writability, not readability. If poll and select are not available, ignore timeout argument. (sock_accept): Use fd_timeout; fall back on non-timed-out accept if poll or select not available.
* Version 236.txr-236Kaz Kylheku2020-04-181-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* configure: simplify shell viability test.Kaz Kylheku2020-04-181-14/+6
| | | | | | | | | | | | | * configure: the golden trick is simply to test whether PS4 contains "+ ". PS2 is not a useful variable, because even crappy old 1980's vintage System V shells set that up. It turns out that Zsh in POSIX mode (when run as /bin/sh) handles configuring and building TXR just fine. And Zsh does set PS4 to "+ " in that mode. However, it does not set PS2, unless run interactively. When run interactively as /bin/sh, Zsh sets PS2 to "> ". So, let us drop the Bash variable tests, and the test for PS2 being "> " and only test PS4.
* configure: include ksh in search.Kaz Kylheku2020-04-181-0/+1
| | | | | * configure: everything works fine with ksh93, so let's add ksh to list of shell to look for.
* configure: detect more good shells.Kaz Kylheku2020-04-171-0/+7
| | | | | | | * configure: There is a clue in the PS2 and PS4 variables. If these are present and have the values "> " and "+ " the shell could be Dash or newer NetBSD Ash, which got PS4 circa 2004. The Solaris XPG shell also has these.
* configure: improve shell search-and-re-execute logic.Kaz Kylheku2020-04-171-16/+46
| | | | | | | | | | | | | | | | | | | | | | | * configure: If we determine we are running on Bash, then do not re-execute. If re-executing, then look for CONFIG_SHELL first, which is an Autoconf convention that some distros rely on. Include dash in the fallback shell list because dash works fine. Include more places in which to look for bash and dash. Uses of txr_shell must be quoted now because it could take on the value of CONFIG_SHELL which we don't control. Print a trace message about re-executing. Print the message about which shell we are running on earlier, before parsing the variables and printing the baner. Since we might not re-execute any more, we might not know the exact name of the shell we are running on. That is difficult and hacky to obtain, so instead we print an alternative message that we are running on the original shell. (gen_config_make): Only generate the SHELL Makefile variable if txr_shell is set. If whatever shell we were run with is good enough for the configure script, it's good enough for Makefile recipes. Likely, the configure script was executed directly, so that /bin/sh is that default shell and that is what GNU Make will use by default.
* Version 235.txr-235Kaz Kylheku2020-04-121-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* warning cleanup: GNU C++ initializer warnings.Kaz Kylheku2020-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This is the eight and final round of an effort to enable GCC's -Wextra option. The C++ compiler, with -Wextra, doesn't like C's universal struct initializer { 0 }, individually complaining about all the remaining members not being initialized. What works in C++ is the { } initializer. Conditional definition to the rescue. * lib.h (all_zero_init): New macro which expands to { } under C++, and { 0 } under C. * lib.c (make_time_impl, epoch_tm, time_string_meth, time_parse_meth): Use all_zero_init. * parser.c (prime_parser): Likewise. * socket.c (sock_mark_connected): Likewise. * sysif.c (fcntl_wrap): Likewise. * termios.c (encode_speeds, decode_speeds): Likewise. * configure (diag_flags): Add -Wextra.
* configure: allow variables to contain quotes.Kaz Kylheku2020-03-251-1/+1
| | | | | | | | | * configure: When generating the assignment that stores the value of the command line variable into the corresponding shell variable, interpolate $val between single quotes in such a way that single quotes occurring in $val are replaced by the pattern '\''. Thus, variables may contain any character whatsoever.
* configure: remove C diagnostic options under C++.Kaz Kylheku2020-03-251-0/+34
| | | | | | | * configure (cplusplus): New variable. Check ccname and cc for signs of C++; if so, set the new variable to 'y'. If the variable is set, then filter C-specific options out of diag_flags.
* Version 234.txr-234Kaz Kylheku2020-03-251-1/+1
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated. * protsym.c: Regenerated.
* gc: small memory support.Kaz Kylheku2020-03-181-0/+10
| | | | | | | | | | | * configure (small_mem): New variable. Provide help text and show default value of --small-mem option. Generate CONFIG_SMALL_MEM in config.h. * gc.c (HEAP_SIZE, CHECKOBJ_VEC_SIZE, MUTOBJ_VEC_SIZE, FULL_GC_INTERVAL, FRESHOBJ_VEC_SIZE, DFL_MALLOC_DELTA_THRESH): Define conservative values of these constants if CONFIG_SMALL_MEM is in effect.
* Version 233.txr-233Kaz Kylheku2020-03-081-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* cygwin: use spawnvp for run and sh.Kaz Kylheku2020-02-171-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | We revive the dead _wspawnvp code that was used on MinGW, a platform that has not been supported for years, adapting it for Cygwin. * configure: Correct the _wspawnlp test; it should have been testing for _wspawnvp function, which is what is is actually used by the matching code. Moreover, the broken test was calling _wspawnlp with _wspawnvp style arguments. Anyway, this is moot because we will never detect this function in the foreseeable future. More importantly, adding a test for spawnvp, which exists on Cygwin. * stream.c: Include the <process.h> header if HAVE_WSPAWN or HAVE_SPAWN. This was missing before; how did the _wspawnvp call ever compile? (w_spawnvp): New static function. (run): spawn version now calls either _wspawwnvp or w_spawnvp if that is not available. We test for HAVE_WSPAWN or HAVE_SPAWN first, before HAVE_FORK_STUFF, so that we use the spawn function preferentially. On Cygwin, we have the fork stuff.
* Version 232.txr-232Kaz Kylheku2020-02-091-1/+1
| | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * txr.vim, tl.vim: Regenerated.
* build: drop config.log in favor of reconfigureKaz Kyheku2020-01-291-10/+41
| | | | | | | | | | | | | | | | | | | | | | | The configure command line is now turned into an executable script called reconfigure which can be invoked to repeat the config. * Makefile (distclean): Whether in a configured or state or not, try to remove reconfigure. In the configured state, don't remove config.log. (If distclean is invoked when not configured, the config.* pattern will remove config.log). * configure: rewrite the logic which turns the command line into text. It is now robust against spaces, quotes and meta-charaters. Moreover, the printed representation is chosen according to good heuristics to minimize unnecessary quoting and escaping. The config line is written into an executable script called reconfigure. This is now done twice; it is done immediately, so that we save the command line even if the configure subsequently fails. A comment is added to reconfigure indicating that configure didn't succeed. Then after a successful run through the tests, we save it again, without the cautionary comment. Help texts updated.
* New functions: chown, lchown.Kaz Kyheku2020-01-281-0/+19
| | | | | | | | | | * configure: New configure test for chown, fchown and lchown. * sysif.c (get_fd): Define for HAVE_CHOWN also. (do_chown, chown_wrap, lchown_wrap): New functions. (sysif_init): chown and lchown intrinsics registered. * txr.1: Documented.
* New function: mkfifo.Kaz Kylheku2020-01-231-0/+21
| | | | | | | * configure: detect mkfifo. (sysif_init): Register mkfifo intrinsic. * txr.1: Documented.
* New functions utimes, lutimes.Kaz Kylheku2020-01-211-0/+108
| | | | | | | | | | | | | * configure: Detect various functions for setting file timestamps. * sysif.c (get_fd): Define this function for use by utimes also. (timens, do_utimes): New static functions. (wrap_utimes, wrap_lutimes): New static functions. (sysif_init): Register utimes and lutimes intrinsics. * txr.1: Documented.