sarah-walker-pcem / arculator

Arculator
http://b-em.bbcmicro.com/arculator
GNU General Public License v2.0
56 stars 23 forks source link

configure: Respect user-provided CFLAGS #25

Closed Sophira closed 1 year ago

Sophira commented 1 year ago

When running, for example, ./configure --enable-debug CFLAGS=-ggdb CXXFLAGS=-ggdb on a Linux system (or by setting the variables before running the script), the CFLAGS and CXXFLAGS variables passed to configure are ignored, as can be seen by grepping the newly-made Makefile:

$ autoreconf -is
<...snipped...>
$ ./configure --enable-debug CFLAGS=-ggdb CXXFLAGS=-ggdb
<...lots of configure output snipped...>
$ grep "^C\(XX\)\?FLAGS =" Makefile
CFLAGS = -Wall -O0 -g -D_DEBUG -DDEBUG_LOG 
CXXFLAGS = -Wall -O0 -g -D_DEBUG -DDEBUG_LOG 

In this case, it feels like the correct thing to do would be to add any current CFLAGS/CXXFLAGS variables to the end, so this pull request does this.