Picture of iqbal
Registered 5 years 279 days
iqbal Thursday, 25 November 2021, 09:47 AM
Setting environment variables with bat file not working
Hi
I have a little issue. i want to set custom BUILD and RELEASESTATE.
Problem is the BUILD variable ist taken by bat and RELEASESTATE not. The RELEASESTATE is always dvl, that is not waht it should be. and i dont want to go to sdk file all time and change it in release.h.
it should work outside from sdk and from my directory.
Bat file look like that:


@echo off

set APPNAME="Routing"
set BUILD=130002
set RELEASE_STATE="\"sr1\""
rem set RELEASESTATE="\"sr1\"" --> tryed
rem set RELEASESTATE=sr1 --> tryed
rem set RELEASE_STATE=sr1 --> tryed

set PATH=%INNOVAPHONE-SDK%\app-platform-buildtls;%INNOVAPHONE-SDK%\arm-7.2.0-linux-gnu\bin;%INNOVAPHONE-SDK%\x86_64-7.2.0-linux-gnu\bin;%INNOVAPHONE-SDK%\aarch64-7.2.0-linux-gnu\bin;

set INCLUDE=sdk;common\lap;%INNOVAPHONE-SDK%\arm-7.2.0-linux-gnu\arm-linux-gnueabi\include\c++\7.2.0;%INNOVAPHONE-SDK%\app-platform-libs\8\armel\usr\include;%INNOVAPHONE-SDK%\app-platform-libs\8\armel\usr\include\postgresql;%INNOVAPHONE-SDK%\arm-7.2.0-linux-gnu\lib\gcc\arm-linux-gnueabi\7.2.0\include;%INNOVAPHONE-SDK%\arm-7.2.0-linux-gnu\arm-linux-gnueabi\include\c++\7.2.0\arm-linux-gnueabi
make -j5 -f %APPNAME%.mak arm

set INCLUDE=sdk;.;common\lap;%INNOVAPHONE-SDK%\x86_64-7.2.0-linux-gnu\x86_64-linux-gnu\include\c++\7.2.0;%INNOVAPHONE-SDK%\app-platform-libs\8\x86_64\usr\include;%INNOVAPHONE-SDK%\app-platform-libs\8\x86_64\usr\include\postgresql;%INNOVAPHONE-SDK%\x86_64-7.2.0-linux-gnu\lib\gcc\x86_64-linux-gnu\7.2.0\include;%INNOVAPHONE-SDK%\x86_64-7.2.0-linux-gnu\x86_64-linux-gnu\include\c++\7.2.0\x86_64-linux-gnu
make -j5 -f %APPNAME%.mak x86_64


BR
Iqbal
Andreas Fink
Moderator Registered 13 years 110 days
Andreas Fink (innovaphone) Thursday, 25 November 2021, 03:37 PM
Re: Setting environment variables with bat file not working
Hello Iqbal,

could you check if the file sdk/platform/sdk-defs.mak contains followin lines?:


ifneq ($(RELEASE_STATE),)
CFLAGS += -D RELEASE_STATE="\"$(RELEASE_STATE)\""
endif

ifeq ($(DEBUG), 1)
CFLAGS += -g3 -O0 -DDEBUG
else
CFLAGS += -g -O3
endif

Probably you have older version of this file.

Best Regards
Andreas Fink


Picture of iqbal
Registered 5 years 279 days
iqbal Thursday, 25 November 2021, 04:31 PM
Re: Setting environment variables with bat file not working
hi Andreas

in sdk i could find sdk/sdk-defs.mak file but it doesnt contain any above described flags.
my sdk version is v2.0.33.0

BR
Iqbal
Andreas Fink
Moderator Registered 13 years 110 days
Andreas Fink (innovaphone) Thursday, 25 November 2021, 05:32 PM
Re: Setting environment variables with bat file not working
add following after "OBJ_EXT = o":


ifneq ($(RELEASE_STATE),)
CFLAGS += -D RELEASE_STATE="\"$(RELEASE_STATE)\""
endif

Probably you have V13r1 SDK, where batch release builds are not supported.

Best Regards
Andreas Fink
Picture of iqbal
Registered 5 years 279 days
iqbal Friday, 26 November 2021, 08:46 AM
Re: Setting environment variables with bat file not working
arm-linux-gnueabi-g++.exe -MMD -MF arm/dep/Routing-main.dep -I sdk -I . -Wall -Werror -fno-delete-null-pointer-checks -c -D NO_LEGACY -D BUILD=130002 -D RELEASE_STATE="\""\"sr1\""\"" -g -O3 -Wno-psabi -isystem "D:\innovaphone-sdk/arm-7.2.0-linux-gnu/arm-linux-gnueabi/include/c++/7.2.0" -isystem "D:\innovaphone-sdk/app-platform-libs/8/armel/usr/include" -fsigned-char -o arm/obj/Routing-main.o Routing-main.cpp
<command-line>:0:20: error: unable to find string literal operator 'operator""sr1' with 'const char [1]', 'unsigned int' arguments
sdk/common/build/release.h:39:32: note: in expansion of macro 'RELEASE_STATE'
const char * _RELEASE_STATE_ = RELEASE_STATE;

^~~~~~~~~~~~~
make: *** [sdk/sdk.mak:34: arm/obj/Routing-main.o] Error 1
x86_64-linux-gnu-g++.exe -MMD -MF x86_64/dep/Routing-main.dep -I sdk -I . -Wall -Werror -fno-delete-null-pointer-checks -c -D NO_LEGACY -D BUILD=130002 -D RELEASE_STATE="\""\"sr1\""\"" -g -O3 -isystem "D:\innovaphone-sdk/x86_64-7.2.0-linux-gnu/x86_64-linux-gnu/include/c++/7.2.0" -isystem "D:\innovaphone-sdk/app-platform-libs/8/x86_64/usr/include" -fsigned-char -o x86_64/obj/Routing-main.o Routing-main.cpp


Picture of iqbal
Registered 5 years 279 days
iqbal Thursday, 25 November 2021, 04:38 PM in response to Andreas Fink (innovaphone)
Re: Setting environment variables with bat file not working
content of sdk/sdk-defs.mak

SHELL = cmd

IP_SRC = sdk
HTTPFILES-FLAGS = -k -s 0,HTTP_GZIP
HTTPFILES-WEB-FLAGS = -k -r web -s 0,HTTP_GZIP

SYSROOT =
INCLUDES = -I sdk -I .
# we need -fno-delete-null-pointer-checks as the btree implementations uses if(!this) ... GCC 6 removes this, as the new standard assumes that this is always NOT NULL
CFLAGS = -Wall -Werror -fno-delete-null-pointer-checks -c -D NO_LEGACY -D BUILD=$(BUILD)
LIBS = -lpthread -luuid -lhpdf -lpng -lcap -lpam -lcrypto -lssl -lmysqlclient -ldl -lz -lpq
OUTDIR = .
BUILDDIR = .
OBJ_EXT = o

ifeq ($(DEBUG), 1)
CFLAGS += -g3 -O0 -DDEBUG
else
CFLAGS += -g -O3
endif

TOOLSDIR := $(INNOVAPHONE-SDK)
ifeq ($(TOOLSDIR),)
# Let's try the old variable we used (T = TOOLS)
TOOLSDIR := $(T)
endif

### x86_64 #############
ifeq ($(MAKECMDGOALS),x86_64)
SYSROOT := $(TOOLSDIR)/app-platform-libs/8/x86_64
ifeq ($(DEBUG),1)
OUTDIR = x86_64-debug
else
OUTDIR = x86_64
endif
CC = x86_64-linux-gnu-g++.exe
AR = x86_64-linux-gnu-ar.exe
OBJCPY = x86_64-linux-gnu-objcopy.exe
CFLAGS += -isystem "$(TOOLSDIR)/x86_64-7.2.0-linux-gnu/x86_64-linux-gnu/include/c++/7.2.0" -isystem "$(SYSROOT)/usr/include" -fsigned-char
LFLAGS += --sysroot="$(SYSROOT)"
LFLAGS += -Wl,-rpath,"$(SYSROOT)/usr/lib"
LFLAGS += -Wl,-rpath,"$(SYSROOT)/lib"
LFLAGS += -Wl,--warn-common
#LFLAGS += -v
#LFLAGS += -Wl,-verbose
#LFLAGS += -Wl,--print-map,--cref
endif

ifeq ($(MAKECMDGOALS),clean-x86_64)
ifeq ($(DEBUG),1)
OUTDIR = x86_64-debug
else
OUTDIR = x86_64
endif
endif
####################

### arm #############
ifeq ($(MAKECMDGOALS),arm)
SYSROOT := $(TOOLSDIR)/app-platform-libs/8/armel
ifeq ($(DEBUG),1)
OUTDIR = arm-debug
else
OUTDIR = arm
endif
CC = arm-linux-gnueabi-g++.exe
AR = arm-linux-gnueabi-ar.exe
OBJCPY = arm-linux-gnueabi-objcopy.exe
CFLAGS += -Wno-psabi -isystem "$(TOOLSDIR)/arm-7.2.0-linux-gnu/arm-linux-gnueabi/include/c++/7.2.0" -isystem "$(SYSROOT)/usr/include" -fsigned-char
LFLAGS += --sysroot="$(SYSROOT)"
LFLAGS += -Wl,-rpath,"$(SYSROOT)/usr/lib"
LFLAGS += -Wl,-rpath,"$(SYSROOT)/lib"
LFLAGS += -Wl,--warn-common
#LFLAGS += -v
#LFLAGS += -Wl,-verbose
endif

ifeq ($(MAKECMDGOALS),clean-arm)
ifeq ($(DEBUG),1)
OUTDIR = arm-debug
else
OUTDIR = arm
endif
endif
ifeq ($(MAKECMDGOALS),clean-x86_64)
ifeq ($(DEBUG),1)
OUTDIR = x86_64-debug
else
OUTDIR = x86_64
endif
endif
####################

ifeq ($(MAKE_SDK),1)
OUTBIN = sdk-out/sdk/lib/$(OUTDIR)
OUTSDK = $(OUTBIN)
else
OUTBIN = $(OUTDIR)
OUTSDK = sdk/lib/$(OUTDIR)
endif

bins = $(OUTDIR) $(OUTDIR)/dep $(OUTDIR)/obj $(OUTBIN)/$(OUT)

force:
← You can define your color theme preference here