Autoconf: We're Doing It Wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Triaged
|
Wishlist
|
Unassigned | ||
OpenSRF |
New
|
Undecided
|
Unassigned |
Bug Description
Even though Evergreen uses GNU autotools, the Makefile.am and other files make assumptions based on GNU/Linux, thus hampering the portability of Evergreen.
The Evergreen Makefiles use the -i option to sed when modifying some files at installation time. This option is problematic because it causes incompatibilities between different versions of sed. For instance, GNU sed will take the -i option unadorned, i.e. without a file name argument. In order to invoke sed on BSD-derived systems without a backup file extension argument requires that an empty quoted string serve as a place holder: -i ''.
GNU sed will accept an empty quoted string argument. However, there is a difference in how the argument must be entered. On BSD sed the -i and empty quoted string arguments must have a space between them. Not having the space causes an error. With GNU sed, the -i and empty quoted string arguments must not have any spaces between them. That is, they must touch like so: -i''. Having spaces between the arguments leads to unexpected behavior or an error.
Additionally, shebang lines are hardcoded in all of our perl and bash scripts. These can and should be inserted at configure/install time using the autotools. Maybe these should be converted to "#!/usr/bin/env (bash|perl)" as is commonly done with python? Bash is often installed under /usr/local/ on the BSDs.
Fixing the above will greatly improve the portability of the Evergreen build system and should help with adding more automated testing support.
summary: |
- Build system makes use of sed -i option + Build system assumes GNU/Linux |
Changed in evergreen: | |
status: | New → Incomplete |
status: | Incomplete → New |
description: | updated |
Changed in evergreen: | |
status: | New → In Progress |
assignee: | nobody → Jason Stephenson (jstephenson) |
Changed in evergreen: | |
assignee: | Jason Stephenson (jstephenson) → nobody |
status: | In Progress → Triaged |
description: | updated |
summary: |
- Build system assumes GNU/Linux + Autoconf: We're Doing It Wrong |
In addition to the specifics mentioned in the description. We should modernize our use of autotools and follow more of the portability recommendations in the autotools documentation.