autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use PREFIX created by autoconf in source file


From: Eric Blake
Subject: Re: How to use PREFIX created by autoconf in source file
Date: Mon, 10 Feb 2014 06:54:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 02/09/2014 05:17 AM, Adam Jiang wrote:
> Autoconf could help to generate configure script which accepts an option
> called --prefix in general. In this way, users could specific a path where
> programs/data installed.

ALL configure scripts generated by autoconf accept --prefix.

It sounds like what you want to do is turn ${prefix} (substituted at
autoconf time) into PREFIX (a C preprocessor macro at compilation time),
using Makefile as the place to do the expansion so as to cover nested
definitions (for example, ${exec_prefix)\} defaults to being defined in
terms of ${prefix}).

That is easy to do; in fact, the gnulib configmake module does just that.

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=modules/configmake

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]