From 32fb54d3fc60c97b865617ef8751562e3474e320 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Thu, 25 May 2023 09:33:55 +1000 Subject: build: Add -I. as the first include path If building on a system with an installed jim.h, we want to be sure to pick up the local jim headers in preference. Signed-off-by: Steve Bennett --- Makefile.in | 18 +++++++++--------- auto.def | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6d46535..29c226b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -40,9 +40,15 @@ SHOBJ_LDFLAGS ?= @SHOBJ_LDFLAGS@ @else SHOBJ_LDFLAGS ?= @SHOBJ_LDFLAGS_R@ @endif -AS_CFLAGS = @AS_CFLAGS@ -AS_CXXFLAGS = @AS_CFLAGS@ -AS_CPPFLAGS = @AS_CPPFLAGS@ +@if [get-define srcdir] ne "." +VPATH := @srcdir@ +AS_CFLAGS = -I@srcdir@ +AS_CXXFLAGS = -I@srcdir@ +@endif + +AS_CFLAGS += @AS_CFLAGS@ +AS_CXXFLAGS += @AS_CFLAGS@ +AS_CPPFLAGS += @AS_CPPFLAGS@ CFLAGS ?= @CFLAGS@ CXXFLAGS ?= @CXXFLAGS@ LDFLAGS = @LDFLAGS@ @@ -53,12 +59,6 @@ prefix ?= @prefix@ docdir = @docdir@ srcdir := @srcdir@ -AS_CPPFLAGS += -Wall -I. -@if [get-define srcdir] ne "." -AS_CPPFLAGS += -I@srcdir@ -VPATH := @srcdir@ -@endif - @if JIM_STATICLIB LIBJIM := libjim.a @else diff --git a/auto.def b/auto.def index 7e35f96..d9058bf 100644 --- a/auto.def +++ b/auto.def @@ -208,9 +208,9 @@ cc-check-types "long long" cc-check-sizeof int # Default optimisation -define-append AS_CPPFLAGS -O2 - -define-append AS_CPPFLAGS -D_GNU_SOURCE +define-append AS_CPPFLAGS -O2 -Wall -D_GNU_SOURCE +define-append AS_CFLAGS -I. +define-append AS_CXXFLAGS -I. # check, but don't add to -cflags cc-with {} { -- cgit v1.1