Commit graph

46 commits

Author SHA1 Message Date
Sören Tempel
26d0e1f9e5
Fix open_memstream/fmemopen feature detection with GCC >= 14 (#544)
GCC 14 has enabled various warnings as errors by default, e.g.
-Wimplicit-function-declaration. This causes the current feature
detection code for `open_memstream(3)` and `fmemopen(3)` to fail
with GCC 14.

This commit restores compatibility with GCC 14 in this regard.

Note that it may also be beneficial to pass a feature test macro
such as -D_POSIX_C_SOURCE. See the feature test macro requirements
for open_memstream(3)` and `fmemopen(3)`.
2024-09-25 22:27:14 -04:00
Sören Tempel
bad43cccc1 Makefile.config: Move -I$(PREFIX)/include from BASE_CFLAGS to CC_LIB
This is a follow up to https://github.com/justinethier/cyclone/pull/482#discussion_r758902860

The -I$(PREFIX)/include needs to be moved away from BASE_CFLAGS since,
otherwise, it will be added *before* ~cc-extra~ and thus (partially)
circumvent the changes from #482. Compare the following two Cyclone
invocations with/without this commit.

Without this commit:

	$ ./cyclone -d -A . -A libs -COPT '-Iinclude' -CLNK '-L.' scheme/complex.sld
	gcc scheme/complex.c […] -I/usr/include -Wl,--export-dynamic -Iinclude -L/usr/lib -c

With this commit applied:

	$ ./cyclone -d -A . -A libs -COPT '-Iinclude' -CLNK '-L.' scheme/complex.sld
	gcc scheme/complex.c […] -Wl,--export-dynamic -Iinclude -I/usr/include -c

In #482, I originally removed the -I$(PREFIX)/include from BASE_CFLAGS
entirely. However, back then I forgot to add $(COMP_INCDIRS) to CC_LIB
to account for that. By doing that, this should fix the error from
https://github.com/justinethier/cyclone/pull/482#discussion_r758902860
and align CC_LIB nicely with CC_PROG.

While at it, I also removed $(COMP_LIBDIRS) from CC_LIB, it shouldn't be
needed since the CC_LIB command compiles object files and doesn't do any
linking.
2021-12-01 09:35:29 +01:00
Sören Tempel
9954cde738 Allow prepending include/library search path through -COPT/-CLNK
This commit separates include/library search directory options from
"normal" compiler/linker options and places options passed via the
`-COPT`/`-CLNK` command-line flags in-between. This allows overwriting
the default search paths, since contrary to all other options, the
search paths must be prepend for an -I/-L option to take precedence over
an existing one.

This should (hopefully) make it entirely unnecessary to ever build
Cyclone twice in order to have all changes in the current source tree
take effect.

Fixes #476
2021-11-24 15:32:17 +01:00
Sören Tempel
86949ae500 Makefile.config: remove unneeded case distinction for Darwin
Both cases do the same thing presently.
2021-11-24 12:05:22 +01:00
Justin Ethier
d2915abe6a Issue #477 - Clean up 2021-08-12 23:01:04 -04:00
Justin Ethier
4ff0bca100 Issue #477 - Added CYC_PTHREAD_SET_STACK_SIZE 2021-08-12 22:46:13 -04:00
Sören Tempel
3bf376c057 Don't use conditional assignment operator for CFLAGS/LDFLAGS
The conditional variable assignment operator in Makefiles (`?=`) will
only assign a value if its not defined yet. However, CFLAGS/LDFLAGS are
commonly defined as environment variables to pass custom compiler/linker
flags (e.g. `-Os`). Unfortunately, Cyclone adds mandatory compiler flags
(without which it doesn't compile) via the conditional variable
assignment operator which is incorrect as these flags will not be added
if CFLAGS/LDFLAGS is defined in the environment. This commit fixes this
issue by appending flags to CFLAGS/LDFLAGS instead of using the
conditional assignment operator.
2021-08-03 06:04:11 +02:00
Justin Ethier
236c7e84f4 Issue #351 - Prevent warnings when compiling with clang 2020-02-28 14:37:37 -05:00
Justin Ethier
63c7413fce Added HRT compiler option 2020-01-21 17:08:08 -05:00
Justin Ethier
70171bf707 Issue #351 2019-12-28 10:12:17 -05:00
Justin Ethier
2f9efe7eda Try suppressing neg left shift warnings 2019-12-19 18:30:08 -05:00
Justin Ethier
a2ca87e825 Revert previous change 2019-12-04 15:56:22 -05:00
Justin Ethier
be8c534739 Use our local library 2019-10-17 18:18:45 -04:00
Justin Ethier
2663945d4c Do not use fPIC when cyclone compiles programs 2019-05-23 14:16:27 -04:00
Adam Feuer
870c1d6495 remove unneeded newline 2019-04-10 09:46:58 -07:00
Adam Feuer
5a1629529c use libtool to create libraries on macOS 2019-04-10 09:42:10 -07:00
Justin Ethier
16bd644abb Sync Adam's changes for Mac 2019-04-09 13:23:55 -04:00
Justin Ethier
40c0b9734f When profiling include -g 2018-12-18 23:01:06 -05:00
Justin Ethier
b50d7360e0 Added opt flag 2018-11-09 11:01:54 -05:00
Justin Ethier
ce3ba0986f Added CYC_PROFILING 2018-08-03 11:59:22 -04:00
Justin Ethier
274bf0acfa Use "rm -rf" instead of rmdir 2017-12-17 18:15:39 -05:00
Justin Ethier
7c56191bc1 Different flags on OSX (??) 2017-11-11 17:55:25 -05:00
Alex Arslan
a076a25966
Fix linker flags for Clang and macOS 2017-11-11 13:18:20 -08:00
Justin Ethier
f25d76747d Sync up with makefile fixes from bootstrap pull req 2017-11-08 18:04:39 -05:00
Justin Ethier
0369788ab6 Remove LIB_CFLAGS 2017-03-28 21:46:39 +00:00
Justin Ethier
e7aa82a156 Revert -O2 flags 2017-03-28 12:45:26 +00:00
Justin Ethier
a6f42b2869 Experimenting with -rdynamic - not sure this is final 2017-03-22 18:39:31 -04:00
Justin Ethier
a93c1e8cde Added so generation and dl lib 2017-03-23 04:47:47 -04:00
Justin Ethier
afcc5eaecd WIP 2017-03-23 00:21:16 -04:00
Justin Ethier
b9c8d2abf4 WIP for libtommath 2017-02-08 18:33:20 -05:00
Justin Ethier
25c4857eba Issue #57 - Added open-input-string 2016-08-26 23:22:13 -04:00
Justin Ethier
374e57e1ff Added missing endif 2016-08-26 03:17:48 -04:00
Justin Ethier
24109550cd Autodetect configuration items 2016-08-26 03:04:39 -04:00
Justin Ethier
1d4d710b3b Selectively-compile open_memstream 2016-08-25 23:48:31 -04:00
Justin Ethier
b534657855 Use new Makefile.config format 2016-08-08 17:11:15 -04:00
Justin Ethier
5f88a68525 Sync changes from cyclone-bootstrap 2016-08-06 17:31:14 -04:00
Justin Ethier
9eaa1ba47c Use -O2 2016-07-30 19:34:57 -04:00
Justin Ethier
44dd3de7ac Added comments 2016-07-30 17:10:43 -04:00
Justin Ethier
b96a9fcedd Added Cyc_compilation_environment() 2016-07-30 01:48:27 -04:00
Justin Ethier
e13f46b39e Cleanup, added internal compilation commands 2016-07-30 00:59:01 -04:00
Justin Ethier
f7a6c872cc Added -Wall to hunt down warnings 2016-07-19 23:22:25 -04:00
Justin Ethier
8f1ad554d9 Use separate configs for X86 / ARM (pi 2) 2015-12-29 23:14:09 -05:00
Justin Ethier
1aa04f75b6 Added cflags for building on raspberry pi 2015-12-30 03:54:31 +00:00
Justin Ethier
fdd30340e5 WIP 2015-07-20 22:55:46 -04:00
Justin Ethier
85cd55bbbf Working on install/uninstall directives 2015-07-16 21:51:59 -04:00
Justin Ethier
cdcf0fefc9 Added install/uninstall stubs 2015-07-15 23:02:30 -04:00