Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

produce correct SYS_LIBS path for Arduino 1.5 #271

Closed
tsankuanglee opened this issue Oct 5, 2014 · 6 comments
Closed

produce correct SYS_LIBS path for Arduino 1.5 #271

tsankuanglee opened this issue Oct 5, 2014 · 6 comments

Comments

@tsankuanglee
Copy link

The source files Arduino 1.5's libraries are in
/usr/share/arduino/libraries//src
rather than (the Arduino 1.x's location)
/usr/share/arduino/libraries/

So can we add something like this

ifeq ($(shell expr $(ARDUINO_VERSION) '>=' 150), 1)
SYS_LIBS := $(patsubst %, %/src, $(SYS_LIBS))
endif

around line 790 before
SYS_LIBS := $(wildcard $(SYS_LIBS) $(addsuffix /utility,$(SYS_LIBS)))

Thanks!

@tsankuanglee
Copy link
Author

Sorry, forgot to say it's Arduino.mk

@sej7278
Copy link
Collaborator

sej7278 commented Oct 5, 2014

just like the rest of 1.5, its all very inconsistent with some libraries having src/ subdirectories but not all, some libraries having utility subdirectories but not all. for example:

/usr/share/arduino/hardware/arduino/sam/libraries/Wire$ tree -L 2
.
├── examples
│   ├── digital_potentiometer
│   └── slave_sender
├── keywords.txt
├── Wire.cpp
└── Wire.h

/usr/share/arduino/hardware/arduino/avr/libraries/Wire$ tree -L 2
.
├── examples
│   ├── digital_potentiometer
│   └── slave_sender
├── keywords.txt
├── utility
│   ├── twi.c
│   └── twi.h
├── Wire.cpp
└── Wire.h

/usr/share/arduino/libraries/Ethernet$ tree -L 2
.
├── examples
│   ├── AdvancedChatServer
│   └── XivelyClientString
├── keywords.txt
├── library.properties
└── src
    ├── Dhcp.cpp
    ├── Dhcp.h
    └── utility

your example doesn't exist, and i'm afraid that patch won't work either. i've no idea how we can work with the seemingly random library structure in 1.5, other than constantly recursively searching for src/avr/sam/utility subdirectories that may or may not exist.

@tsankuanglee
Copy link
Author

You are right -- the patch won't work for example 1 and 2, which I forgot. I was trying to use /usr/share/arduino/libraries/LiquidCrystal/ and its *.[cpp|h] are in /usr/share/arduino/libraries/LiquidCrystal/src (like your example 3) so I just added src/ and that worked for me.

Is recursive searching on the roadmap?

Not fluent in Makefile language, I'm not sure how difficult it is to implement it in pure Makefile. That said, is calling some external tool, say, perl, a good approach? Or perhaps there's a way to just use find. If this approach is OK, I may give it a try.

@sej7278
Copy link
Collaborator

sej7278 commented Oct 5, 2014

its possible to do recursive searching in a makefile, like rwildcard, buts its splitting it up into the LOCAL_SRC_, ARDUINO_LIBS_ and USER_LIB* variables that's the problem. i think we need to ditch all of those and just treat everything as "sourcecode" to be searched for.

it would also help with the "subfolder" requests like #267 #251 #249 and possibly even #93 not just 1.5 compatibility.

python we'd probably be ok with as we already depend on it, or a shell-out like find, but we've gotten rid of the perl dependency so probably best not to put it back.

i think its beyond me, or at least would be a lot of work, and i'm not really interested in 1.5 anymore, its so badly implemented.

a lot of this has already been discussed on the 1.5 support issue #45

@tsankuanglee
Copy link
Author

Thank you for the reply. I'll close this one to avoid duplication and follow those issues/requets instead then.

@sej7278
Copy link
Collaborator

sej7278 commented Oct 5, 2014

no problem. we always welcome pull requests by the way ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants