cannot disable unwanted modules

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

cannot disable unwanted modules

Post by devnull » Tue Apr 02, 2019 12:22 am

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 ??

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: cannot disable unwanted modules

Post by jickster » Tue Apr 02, 2019 12:30 am

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

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: cannot disable unwanted modules

Post by devnull » Tue Apr 02, 2019 2:17 am

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

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: cannot disable unwanted modules

Post by Roberthh » Tue Apr 02, 2019 5:33 am

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.

Post Reply