@@ -370,7 +370,7 @@ cat configs/pio_start.txt > "$AR_PLATFORMIO_PY"
370
370
371
371
# Process include directories and implement include path shortening
372
372
# This is equivalent to the Python shorthen_includes() function
373
- # We collect shortened include paths and copy all header files to the SDK
373
+ # We collect shortened include paths and copy all header files to the esp32-arduino-libs
374
374
REL_INC=" " # Will contain the shortened include paths
375
375
set -- $INCLUDES
376
376
@@ -409,7 +409,7 @@ for item; do
409
409
# Add to shortened include paths (using GCC's -iwithprefix mechanism)
410
410
REL_INC+=" -iwithprefixbefore $fname$out_sub "
411
411
412
- # Copy all header files to the SDK include directory
412
+ # Copy all header files to the esp32-arduino-libs include directory
413
413
# This ensures all headers are available at build time
414
414
for f in ` find " $item " -name ' *.h' ` ; do
415
415
rel_f=${f#* $item }
@@ -449,18 +449,18 @@ else
449
449
echo " \" -march=rv32imc\" ," >> " $AR_PLATFORMIO_PY " # RISC-V architecture
450
450
fi
451
451
452
- # Add shortened include paths for assembly files
452
+ # Add shortened include paths for assembly files using esp32-arduino-libs structure
453
453
# This implements the same logic as the Python shorthen_includes() function
454
454
if [[ -n " $REL_INC " ]]; then
455
- echo " \" -iprefix\" , join(FRAMEWORK_DIR, \" tools\" , \" esp32-arduino-libs\" , \" $IDF_TARGET \" )," >> " $AR_PLATFORMIO_PY "
455
+ echo " \" -iprefix\" , join(FRAMEWORK_DIR, \" tools\" , \" esp32-arduino-libs\" , \" $IDF_TARGET \" , \" include \" )," >> " $AR_PLATFORMIO_PY "
456
456
# Parse the REL_INC string and convert -iwithprefixbefore to -iwithprefix
457
457
IFS=' ' read -ra rel_inc_array <<< " $REL_INC"
458
458
i=0
459
459
while [ $i -lt ${# rel_inc_array[@]} ]; do
460
460
if [[ " ${rel_inc_array[$i]} " == " -iwithprefixbefore" ]]; then
461
461
if [ $(( i+ 1 )) -lt ${# rel_inc_array[@]} ]; then
462
462
path=" ${rel_inc_array[$((i+1))]} "
463
- echo " \" -iwithprefix/include/ $path \" ," >> " $AR_PLATFORMIO_PY "
463
+ echo " \" -iwithprefix/$path \" ," >> " $AR_PLATFORMIO_PY "
464
464
i=$(( i+ 2 )) # Skip both flag and path
465
465
else
466
466
i=$(( i+ 1 ))
@@ -517,17 +517,17 @@ for item; do
517
517
echo " \" $item \" ," >> " $AR_PLATFORMIO_PY "
518
518
done
519
519
520
- # Add shortened include paths for C/C++ compilation
520
+ # Add shortened include paths for C/C++ compilation using esp32-arduino-libs structure
521
521
# This is the core of the include path shortening mechanism
522
522
if [[ -n " $REL_INC " ]]; then
523
- echo " \" -iprefix\" , join(FRAMEWORK_DIR, \" tools\" , \" esp32-arduino-libs\" , \" $IDF_TARGET \" )," >> " $AR_PLATFORMIO_PY "
523
+ echo " \" -iprefix\" , join(FRAMEWORK_DIR, \" tools\" , \" esp32-arduino-libs\" , \" $IDF_TARGET \" , \" include \" )," >> " $AR_PLATFORMIO_PY "
524
524
IFS=' ' read -ra rel_inc_array <<< " $REL_INC"
525
525
i=0
526
526
while [ $i -lt ${# rel_inc_array[@]} ]; do
527
527
if [[ " ${rel_inc_array[$i]} " == " -iwithprefixbefore" ]]; then
528
528
if [ $(( i+ 1 )) -lt ${# rel_inc_array[@]} ]; then
529
529
path=" ${rel_inc_array[$((i+1))]} "
530
- echo " \" -iwithprefix/include/ $path \" ," >> " $AR_PLATFORMIO_PY "
530
+ echo " \" -iwithprefix/$path \" ," >> " $AR_PLATFORMIO_PY "
531
531
i=$(( i+ 2 ))
532
532
else
533
533
i=$(( i+ 1 ))
@@ -586,8 +586,8 @@ for item; do
586
586
PIO_LIBS+=" \" $item \" "
587
587
done
588
588
589
- # Strip debug symbols from libraries and copy them to SDK
590
- # This reduces the size of the final SDK package
589
+ # Strip debug symbols from libraries and copy them to esp32-arduino-libs
590
+ # This reduces the size of the final esp32-arduino-libs package
591
591
set -- $LD_LIB_FILES
592
592
for item; do
593
593
" $TOOLCHAIN -strip" -g " $item " # Remove debug symbols
@@ -683,7 +683,7 @@ for item; do
683
683
done
684
684
done
685
685
686
- # Strip debug symbols from specific large libraries to reduce SDK size
686
+ # Strip debug symbols from specific large libraries to reduce esp32-arduino-libs size
687
687
for lib in " openthread" " espressif__esp-tflite-micro" " bt" " espressif__esp_modem" " espressif__esp-zboss-lib" " espressif__esp-zigbee-lib" " espressif__mdns" " espressif__esp-dsp" " espressif__esp32-camera" " joltwallet__littlefs" ; do
688
688
if [ -f " $AR_SDK /lib/lib$lib .a" ]; then
689
689
echo " Stripping $AR_SDK /lib/lib$lib .a"
0 commit comments