I'm in the process of building Nginx on my Raspberry Pi Zero W and, when finished, I would like to submit it as an extension.
However, before I do that, I have a number of questions that I am hoping I can get answers to:
1. Static or Dynamically-linked libraries?
Nginx depends on 'pcre' and 'openssl'. It can be built without these, but the result is much reduced functionality. I intend to include these in the build. Do I have to dynamically link these libraries when I build or can I build them into the nginx binary itself, ie. static? Also, if the latter, can I use more recent versions of them (the tcz repos have pcre-8.39 and openssl-1.0.2j while the latest versions are 8.42 and 1.1.0i, respectively)? pcre2-10.31 also exists. Should I build with that instead of pcre?
2. Compiler Flags
What are the recommended compiler flags for the Raspberry Pi Zero W? I have come across these for the Raspberry Pi 2 but, I'm not sure if they're appropriate:
export CFLAGS="-Os -pipe"
export CXXFLAGS="-Os -pipe -fno-exceptions -fno-rtti"
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
Could someone please advise?
3. Directory locations
I recall reading somewhere that extensions should go in /usr/local/<packagename>, eg. configure --prefix=/usr/local/nginx
Is this correct? If so, are there any other limitations on where I can place the built objects:
- binary files - eg. /usr/local/nginx/sbin/ or /usr/local/sbin/ ?
- library files - eg. /usr/local/nginx/lib/ or /usr/local/lib/ ?
- config files - eg. /usr/local/nginx/etc/ or /usr/local/etc/ ?
- log files - eg. /usr/local/nginx/var/log/ or /usr/local/var/log/ ?
- pid files - eg. /usr/local/nginx/var/run/ or /usr/local/var/run/ ?
I would like to comply fully with TC standards so any advice is appreciated.
4. Other help
I've found these resources to help me:
Are there any others?
Cheers
PingPing