Menu

Source-code Merge Request #10: Expand directory variables at build time rather than at configuration time (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

George Matsumura wants to merge 1 commit from /u/gorg/gimp-print/ to master, 2024-04-12

This change moves the expansion of various installation directory variables such as prefix, exec_prefix, and datarootdir from its current location in the configure script to build time via preprocessor flags. This is in line with guidelines here:

https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Installation-Directory-Variables.html

that state:

In order to support these features [specification of prefixes at build time], it is essential that datarootdir remains defined as ‘${prefix}/share’, so that its value can be expanded based on the current value of prefix.

A corollary is that you should not use these variables except in makefiles. For instance, instead of trying to evaluate datadir in configure and hard-coding it in makefiles using e.g., ‘AC_DEFINE_UNQUOTED([DATADIR], ["$datadir"], [Data directory.])’, you should add -DDATADIR='$(datadir)' to your makefile's definition of CPPFLAGS (AM_CPPFLAGS if you are also using Automake).

By complying with the above, this prevents bugs arising from interaction of the build system with packaging systems that rely on values of exec_prefix and other variables being substituted at build time such as: https://sourceforge.net/p/gimp-print/bugs/732/

This change would effectively undo much of this commit by Robert Krawitz: https://sourceforge.net/p/gimp-print/source/ci/b6043e06360cd0d0b361a2d27e87b1a1fe720439

I tested this with a variety of configure and build options that would hit different cases that were replaced. The cases that worked previously should continue to behave identically, and the cases that did not work should be fixed.

This does not alter the definition of CUPS driver installation directories that depend on cups_prefix.

Commit Date  
[32bc09] (build_time_expansion) by George Matsumura George Matsumura

build: Move expansion of pathnames to build time

This corrects errors in expansion encountered under the previous
scheme, and is in line with autoconf recommendations.

2022-07-17 03:41:13 Tree

Discussion

  • Solomon Peachy

    Solomon Peachy - 2024-04-12

    I'm concerned this will break the built-in regression test targets; I'll do a test run and if everything passes I'll merge this.

     
  • Solomon Peachy

    Solomon Peachy - 2024-04-12
    • Status: open --> merged
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.