bugThe FreeType Project - Bugs: bug #38235, freetype-config: lacks proper path...

 
 
Show feedback again

bug #38235: freetype-config: lacks proper path substitution

Submitted by:  Michał Górny <michalgorny>
Submitted on:  Sat 02 Feb 2013 12:34:28 PM UTC  
 
Severity: 3 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.4.12

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 08 Feb 2013 09:07:00 PM UTC, comment #6:

Seems to work great. Thanks.

Michał Górny <michalgorny>
Fri 08 Feb 2013 12:00:35 PM UTC, comment #5:

Fixed in git. Please test.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sat 02 Feb 2013 01:43:55 PM UTC, comment #4:

Well, I already did but savannah broke it a bit. Lemme rework it.

freetype-config.in does not require any changes itself.

configure.ac requires removing 'freetype-config' from AC_CONFIG_FILES.

Makefile needs to generate freetype-config from freetype-config.in. The generic rule would be:

with the s|| lines repeated for all variables used in freetype-config.in, and global-scope variables set in Makefiles appropriately.

Michał Górny <michalgorny>
Sat 02 Feb 2013 01:15:20 PM UTC, comment #3:

If you can provide a patch for freetype-config.in together with a generic makefile rule which does what you think it should do, this would be great. Don't worry about the small details and integration into FreeType, I'll handle that later on.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sat 02 Feb 2013 01:03:50 PM UTC, comment #2:

That is no problem, just s/automake/make/.

And I can't point to a foo-config script which does the right thing because those scripts never do the right thing. I would be happy to provide the patch for it but this build system is so ugly I can't find the right place.

The general method is to remove 'freetype-config' from AC_CONFIG_FILES, and do something similar to the following generic snippet in the Makefile:

$(BUILD_DIR)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in
rm -f $@ $@.tmp
sed -e 's|@libdir@|$(libdir)|' \
-e 's|@includedir@|$(includedir)|' $< > $@.tmp
chmod +x $@.tmp
chmod a-w $@.tmp
mv $@.tmp $@

Please note that I may have used the wrong build path variables, and you need to put all the @@ substitutions to that sed call. Also, you need to make the install target depend on the generated file.

Michał Górny <michalgorny>
Sat 02 Feb 2013 12:39:25 PM UTC, comment #1:

Well, FreeType doesn't use automake...

Can you point to a foo-config script which you believe does the right thing?

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Sat 02 Feb 2013 12:34:28 PM UTC, original submission:

The freetype-config script is created using autoconf substitution while it should use proper sed substitution done by automake. This results in semi-random failures with various path settings.

For example, using:

./configure --includedir='${libdir}'/freetype2/include

results in proper installation yet freetype-config reads:

prefix=/usr
exec_prefix=${prefix}
exec_prefix_set=no
includedir=${libdir}/freetype2/include
libdir=/usr/lib64

which is of course invalid. Although changing order would help here, it will break again if someone used '$(libdir)' instead (which is a valid option to make) or some other variable which was not explicitly listed by the author.

The proper solution is to let automake perform the path variable substitution and use evaluated paths in the file. The common way of doing that is to use sed.

Michał Górny <michalgorny>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by michalgorny (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 08 Feb 2013 12:00:35 PM UTCwlStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.4.12
    Sat 02 Feb 2013 12:39:36 PM UTCwlStatusNone=>Need Info
    Sat 02 Feb 2013 12:39:25 PM UTCwlAssigned toNone=>wl
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup