Page 1 of 1

cannot disable unwanted modules

Posted: Tue Apr 02, 2019 12:22 am
by devnull
I am trying to remove some of the modules that I don't need.

This is my GNUmakefile that is included in the ports/esp8266 folder:

Code: Select all

include Makefile
CFLAGS += -Wno-error
CT_ALLOW_BUILD_AS_ROOT=y

MICROPY_PY_BTREE = 0
MICROPY_PY_USSL = 0
MICROPY_SSL_AXTLS = 0
However after build and flash to the device, the btree and ussl modules are still there :

Code: Select all

>>> help('modules')
__main__          inisetup          sh1106_i2c        ure
_boot             json              socket            uselect
_onewire          jsondb            sys               usocket
_webrepl          lwip              time              ussl
adbat             machine           ubinascii         ustruct
apa102            math              ucollections      utime
array             micropython       uctypes           utimeq
btree             neopixel          uerrno            uzlib
builtins          network           uhashlib          webrepl
ds18x20           ntptime           uheapq            webrepl_setup
errno             oled              uio               websocket
esp               onewire           ujson             websocket_helper
flashbdev         os                uos               wget
framebuf          port_diag         upip              wlan
gc                select            upip_utarfile     writer
gpio8266          sh                urandom           www
Plus any modules on the filesystem
What am I doing wrong ??

Re: cannot disable unwanted modules

Posted: Tue Apr 02, 2019 12:30 am
by jickster
If you want to do it via the makefile, the actual compilation command for a given .c file has to resolve to

-DSOME_MACRO=0

I don’t think your syntax resolves to the above format.

You could also change mpconfigport.h


Sent from my iPhone using Tapatalk Pro

Re: cannot disable unwanted modules

Posted: Tue Apr 02, 2019 2:17 am
by devnull
Thanks for helping, but I don't really understand what you're proposing :-)

I would rather use GNUMakefile than start to modify other files as I automatically include it as a symbolic link in by build scripts for all the platforms I am building on.

Code: Select all

MICROPY_PY_BTREE = 1
is defined in the Makefile so I thought that the override to this would simply be :

Code: Select all

MICROPY_PY_BTREE = 0
If not would you mind letting me know how I can override it ?

Thanks again

Re: cannot disable unwanted modules

Posted: Tue Apr 02, 2019 5:33 am
by Roberthh
You have to change the setting in Makefile to:

Code: Select all

MICROPY_PY_BTREE ?= 1
to make the setting in GNUmakefile effective. But in that case you can as well have the change in Makefile itself.