Skip to content

Commit 6556bfb

Browse files
committed
autotools: use AM_CFLAGS
Use `AM_CFLAGS` to pass custom, per-target C flags. This replaces using `CFLAGS` which triggered this warning when running `autoreconf -fi`: ``` tests/Makefile.am:8: warning: 'CFLAGS' is a user variable, you should not override it; tests/Makefile.am:8: use 'AM_CFLAGS' instead ``` (Only for `tests`, even though `example` and `src` also used this method. The warning is also missing from curl, that also uses `CFLAGS`.) Follow-up to 3ec53f3 libssh2#1286 Closes libssh2#1378
1 parent ae2770d commit 6556bfb

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

example/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src -I$(top_srcdir)/include
1111
LDADD = $(top_builddir)/src/libssh2.la
1212

1313
# This might hold -Werror
14-
CFLAGS += @LIBSSH2_CFLAG_EXTRAS@
14+
AM_CFLAGS = @LIBSSH2_CFLAG_EXTRAS@

src/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ lib_LTLIBRARIES = libssh2.la
2020
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/include
2121

2222
# This might hold -Werror
23-
CFLAGS += @LIBSSH2_CFLAG_EXTRAS@
23+
AM_CFLAGS = @LIBSSH2_CFLAG_EXTRAS@
2424

2525
VERSION=-version-info 1:1:0
2626

tests/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SUBDIRS = ossfuzz
55
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src -I$(top_srcdir)/include
66

77
# This might hold -Werror
8-
CFLAGS += @LIBSSH2_CFLAG_EXTRAS@
8+
AM_CFLAGS = @LIBSSH2_CFLAG_EXTRAS@
99

1010
# Get DOCKER_TESTS, DOCKER_TESTS_STATIC, STANDALONE_TESTS, STANDALONE_TESTS_STATOC, SSHD_TESTS,
1111
# librunner_la_SOURCES defines and *_LDFLAGS for statically linked tests.

0 commit comments

Comments
 (0)