Autoconf: We're Doing It Wrong

Bug #968531 reported by Jason Stephenson
10
This bug affects 2 people
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.

Tags: bitesize build
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
Revision history for this message
Jason Stephenson (jstephenson) wrote : Re: Build system assumes GNU/Linux

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.

description: updated
summary: - Build system assumes GNU/Linux
+ Autoconf: We're Doing It Wrong
Revision history for this message
Jason Stephenson (jstephenson) wrote :

There are places where we install files using the cp command, notably with ilscore-install in Open-ILS/src/Makefile.am. These should be done with lists of files in variables that are assigned to install targets so that autoconf/configure can determine the appropriate thing to do depending on the operating system target.

The dosubst and sed should be replaced by using in files and the appropriate M4 macros to the files handled.

We should lose our dependecy on GNU Make by using only portable Make constructs in our Makefile.am files. I don't recall off the top of my head but the are places in our Makefile.am files that we do something only GNU Make does. We should change that to leverage autotools.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.