[2/3] configure: also add EXTRA_PREFIX to {CPP/LD}FLAGS
diff mbox series

Message ID 20200505092454.9161-3-roger.pau@citrix.com
State New
Headers show
Series
  • build: fixes for clang 10
Related show

Commit Message

Roger Pau Monné May 5, 2020, 9:24 a.m. UTC
The path provided by EXTRA_PREFIX should be added to the search path
of the configure script, like it's done in Config.mk. Not doing so
makes the search path for configure differ from the search path used
by the build.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Please re-run autoconf.sh after applying.
---
 m4/set_cflags_ldflags.m4 | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Wei Liu May 6, 2020, 1:07 p.m. UTC | #1
On Tue, May 05, 2020 at 11:24:53AM +0200, Roger Pau Monne wrote:
> The path provided by EXTRA_PREFIX should be added to the search path
> of the configure script, like it's done in Config.mk. Not doing so
> makes the search path for configure differ from the search path used
> by the build.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Wei Liu <wl@xen.org>
Bertrand Marquis May 22, 2020, 8:41 a.m. UTC | #2
Hi,

As a consequence of this fix, the following has been committed (I guess as a consequence of regenerating the configure scripts):
diff --git a/tools/configure b/tools/configure
index 375430df3f..36596389b8 100755
--- a/tools/configure
+++ b/tools/configure
@@ -4678,6 +4678,10 @@ for ldflag in $APPEND_LIB
 do
     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
 done
+if  ! -z $EXTRA_PREFIX ; then
+    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
+    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
+fi
 CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
 LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS”

This should be:
if  [ ! -z $EXTRA_PREFIX ]; then

As on other configure scripts.

During configure I have not the following error:
./configure: line 4681: -z: command not found

Which is ignored but is adding -L/lib and -I/include to the CPPFLAGS and LDFLAGS

What should be the procedure to actually fix that (as the problem is coming from the configure script regeneration I guess) ? 

Bertrand

> On 5 May 2020, at 10:24, Roger Pau Monne <roger.pau@citrix.com> wrote:
> 
> The path provided by EXTRA_PREFIX should be added to the search path
> of the configure script, like it's done in Config.mk. Not doing so
> makes the search path for configure differ from the search path used
> by the build.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Please re-run autoconf.sh after applying.
> ---
> m4/set_cflags_ldflags.m4 | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
> index cbad3c10b0..08f5c983cc 100644
> --- a/m4/set_cflags_ldflags.m4
> +++ b/m4/set_cflags_ldflags.m4
> @@ -15,6 +15,10 @@ for ldflag in $APPEND_LIB
> do
>     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
> done
> +if [ ! -z $EXTRA_PREFIX ]; then
> +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
> +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> +fi
> CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
> LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS"])
> 
> -- 
> 2.26.2
> 
>
Wei Liu May 22, 2020, 9:05 a.m. UTC | #3
On Fri, May 22, 2020 at 08:41:17AM +0000, Bertrand Marquis wrote:
> Hi,
> 
> As a consequence of this fix, the following has been committed (I guess as a consequence of regenerating the configure scripts):
> diff --git a/tools/configure b/tools/configure
> index 375430df3f..36596389b8 100755
> --- a/tools/configure
> +++ b/tools/configure
> @@ -4678,6 +4678,10 @@ for ldflag in $APPEND_LIB
>  do
>      APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
>  done
> +if  ! -z $EXTRA_PREFIX ; then
> +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
> +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> +fi
>  CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
>  LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS”
> 
> This should be:
> if  [ ! -z $EXTRA_PREFIX ]; then
> 
> As on other configure scripts.
> 
> During configure I have not the following error:
> ./configure: line 4681: -z: command not found
> 
> Which is ignored but is adding -L/lib and -I/include to the CPPFLAGS and LDFLAGS
> 
> What should be the procedure to actually fix that (as the problem is coming from the configure script regeneration I guess) ? 

Does the following patch work for you?

diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
index 08f5c983cc63..cd34c139bc94 100644
--- a/m4/set_cflags_ldflags.m4
+++ b/m4/set_cflags_ldflags.m4
@@ -15,7 +15,7 @@ for ldflag in $APPEND_LIB
 do
     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
 done
-if [ ! -z $EXTRA_PREFIX ]; then
+if test ! -z $EXTRA_PREFIX ; then
     CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
     LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
 fi


You will need to run autogen.sh to regenerate tools/configure.

Wei.

> 
> Bertrand
> 
> > On 5 May 2020, at 10:24, Roger Pau Monne <roger.pau@citrix.com> wrote:
> > 
> > The path provided by EXTRA_PREFIX should be added to the search path
> > of the configure script, like it's done in Config.mk. Not doing so
> > makes the search path for configure differ from the search path used
> > by the build.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> > Please re-run autoconf.sh after applying.
> > ---
> > m4/set_cflags_ldflags.m4 | 4 ++++
> > 1 file changed, 4 insertions(+)
> > 
> > diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
> > index cbad3c10b0..08f5c983cc 100644
> > --- a/m4/set_cflags_ldflags.m4
> > +++ b/m4/set_cflags_ldflags.m4
> > @@ -15,6 +15,10 @@ for ldflag in $APPEND_LIB
> > do
> >     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
> > done
> > +if [ ! -z $EXTRA_PREFIX ]; then
> > +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
> > +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> > +fi
> > CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
> > LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS"])
> > 
> > -- 
> > 2.26.2
> > 
> > 
>
Bertrand Marquis May 22, 2020, 9:37 a.m. UTC | #4
Hi,

> On 22 May 2020, at 10:05, Wei Liu <wl@xen.org> wrote:
> 
> On Fri, May 22, 2020 at 08:41:17AM +0000, Bertrand Marquis wrote:
>> Hi,
>> 
>> As a consequence of this fix, the following has been committed (I guess as a consequence of regenerating the configure scripts):
>> diff --git a/tools/configure b/tools/configure
>> index 375430df3f..36596389b8 100755
>> --- a/tools/configure
>> +++ b/tools/configure
>> @@ -4678,6 +4678,10 @@ for ldflag in $APPEND_LIB
>> do
>>     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
>> done
>> +if  ! -z $EXTRA_PREFIX ; then
>> +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
>> +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
>> +fi
>> CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
>> LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS”
>> 
>> This should be:
>> if  [ ! -z $EXTRA_PREFIX ]; then
>> 
>> As on other configure scripts.
>> 
>> During configure I have not the following error:
>> ./configure: line 4681: -z: command not found
>> 
>> Which is ignored but is adding -L/lib and -I/include to the CPPFLAGS and LDFLAGS
>> 
>> What should be the procedure to actually fix that (as the problem is coming from the configure script regeneration I guess) ? 
> 
> Does the following patch work for you?
> 
> diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
> index 08f5c983cc63..cd34c139bc94 100644
> --- a/m4/set_cflags_ldflags.m4
> +++ b/m4/set_cflags_ldflags.m4
> @@ -15,7 +15,7 @@ for ldflag in $APPEND_LIB
> do
>     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
> done
> -if [ ! -z $EXTRA_PREFIX ]; then
> +if test ! -z $EXTRA_PREFIX ; then
>     CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
>     LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> fi
> 
> 
> You will need to run autogen.sh to regenerate tools/configure.
> 

Yes that works on my side and generate tools/configure using “test”

But why are the [] being removed when generating tools/configure ?

Bertrand

> Wei.
> 
>> 
>> Bertrand
>> 
>>> On 5 May 2020, at 10:24, Roger Pau Monne <roger.pau@citrix.com> wrote:
>>> 
>>> The path provided by EXTRA_PREFIX should be added to the search path
>>> of the configure script, like it's done in Config.mk. Not doing so
>>> makes the search path for configure differ from the search path used
>>> by the build.
>>> 
>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>> ---
>>> Please re-run autoconf.sh after applying.
>>> ---
>>> m4/set_cflags_ldflags.m4 | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>> 
>>> diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
>>> index cbad3c10b0..08f5c983cc 100644
>>> --- a/m4/set_cflags_ldflags.m4
>>> +++ b/m4/set_cflags_ldflags.m4
>>> @@ -15,6 +15,10 @@ for ldflag in $APPEND_LIB
>>> do
>>>    APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
>>> done
>>> +if [ ! -z $EXTRA_PREFIX ]; then
>>> +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
>>> +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
>>> +fi
>>> CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
>>> LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS"])
>>> 
>>> -- 
>>> 2.26.2
Wei Liu May 22, 2020, 9:59 a.m. UTC | #5
On Fri, May 22, 2020 at 09:37:51AM +0000, Bertrand Marquis wrote:
> Hi,
> 
> > On 22 May 2020, at 10:05, Wei Liu <wl@xen.org> wrote:
> > 
> > On Fri, May 22, 2020 at 08:41:17AM +0000, Bertrand Marquis wrote:
> >> Hi,
> >> 
> >> As a consequence of this fix, the following has been committed (I guess as a consequence of regenerating the configure scripts):
> >> diff --git a/tools/configure b/tools/configure
> >> index 375430df3f..36596389b8 100755
> >> --- a/tools/configure
> >> +++ b/tools/configure
> >> @@ -4678,6 +4678,10 @@ for ldflag in $APPEND_LIB
> >> do
> >>     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
> >> done
> >> +if  ! -z $EXTRA_PREFIX ; then
> >> +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
> >> +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> >> +fi
> >> CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
> >> LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS”
> >> 
> >> This should be:
> >> if  [ ! -z $EXTRA_PREFIX ]; then
> >> 
> >> As on other configure scripts.
> >> 
> >> During configure I have not the following error:
> >> ./configure: line 4681: -z: command not found
> >> 
> >> Which is ignored but is adding -L/lib and -I/include to the CPPFLAGS and LDFLAGS
> >> 
> >> What should be the procedure to actually fix that (as the problem is coming from the configure script regeneration I guess) ? 
> > 
> > Does the following patch work for you?
> > 
> > diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
> > index 08f5c983cc63..cd34c139bc94 100644
> > --- a/m4/set_cflags_ldflags.m4
> > +++ b/m4/set_cflags_ldflags.m4
> > @@ -15,7 +15,7 @@ for ldflag in $APPEND_LIB
> > do
> >     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
> > done
> > -if [ ! -z $EXTRA_PREFIX ]; then
> > +if test ! -z $EXTRA_PREFIX ; then
> >     CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
> >     LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> > fi
> > 
> > 
> > You will need to run autogen.sh to regenerate tools/configure.
> > 
> 
> Yes that works on my side and generate tools/configure using “test”
> 
> But why are the [] being removed when generating tools/configure ?

No idea why autoconf removed [] really.

I think switching to test is better anyway since that's what is used
throughout tools/configure.

Wei.
Roger Pau Monné May 22, 2020, 11:19 a.m. UTC | #6
On Fri, May 22, 2020 at 10:05:53AM +0100, Wei Liu wrote:
> On Fri, May 22, 2020 at 08:41:17AM +0000, Bertrand Marquis wrote:
> > Hi,
> > 
> > As a consequence of this fix, the following has been committed (I guess as a consequence of regenerating the configure scripts):
> > diff --git a/tools/configure b/tools/configure
> > index 375430df3f..36596389b8 100755
> > --- a/tools/configure
> > +++ b/tools/configure
> > @@ -4678,6 +4678,10 @@ for ldflag in $APPEND_LIB
> >  do
> >      APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
> >  done
> > +if  ! -z $EXTRA_PREFIX ; then
> > +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
> > +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> > +fi
> >  CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
> >  LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS”
> > 
> > This should be:
> > if  [ ! -z $EXTRA_PREFIX ]; then
> > 
> > As on other configure scripts.
> > 
> > During configure I have not the following error:
> > ./configure: line 4681: -z: command not found
> > 
> > Which is ignored but is adding -L/lib and -I/include to the CPPFLAGS and LDFLAGS
> > 
> > What should be the procedure to actually fix that (as the problem is coming from the configure script regeneration I guess) ? 
> 
> Does the following patch work for you?
> 
> diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
> index 08f5c983cc63..cd34c139bc94 100644
> --- a/m4/set_cflags_ldflags.m4
> +++ b/m4/set_cflags_ldflags.m4
> @@ -15,7 +15,7 @@ for ldflag in $APPEND_LIB
>  do
>      APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
>  done
> -if [ ! -z $EXTRA_PREFIX ]; then
> +if test ! -z $EXTRA_PREFIX ; then
>      CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
>      LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
>  fi

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

My bad, I assume [] is expanded by m4, as that seems to be part of the
language?

Thanks, Roger.
Bertrand Marquis May 22, 2020, 11:40 a.m. UTC | #7
> On 22 May 2020, at 12:19, Roger Pau Monné <roger.pau@citrix.com> wrote:
> 
> On Fri, May 22, 2020 at 10:05:53AM +0100, Wei Liu wrote:
>> On Fri, May 22, 2020 at 08:41:17AM +0000, Bertrand Marquis wrote:
>>> Hi,
>>> 
>>> As a consequence of this fix, the following has been committed (I guess as a consequence of regenerating the configure scripts):
>>> diff --git a/tools/configure b/tools/configure
>>> index 375430df3f..36596389b8 100755
>>> --- a/tools/configure
>>> +++ b/tools/configure
>>> @@ -4678,6 +4678,10 @@ for ldflag in $APPEND_LIB
>>> do
>>>     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
>>> done
>>> +if  ! -z $EXTRA_PREFIX ; then
>>> +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
>>> +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
>>> +fi
>>> CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
>>> LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS”
>>> 
>>> This should be:
>>> if  [ ! -z $EXTRA_PREFIX ]; then
>>> 
>>> As on other configure scripts.
>>> 
>>> During configure I have not the following error:
>>> ./configure: line 4681: -z: command not found
>>> 
>>> Which is ignored but is adding -L/lib and -I/include to the CPPFLAGS and LDFLAGS
>>> 
>>> What should be the procedure to actually fix that (as the problem is coming from the configure script regeneration I guess) ? 
>> 
>> Does the following patch work for you?
>> 
>> diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
>> index 08f5c983cc63..cd34c139bc94 100644
>> --- a/m4/set_cflags_ldflags.m4
>> +++ b/m4/set_cflags_ldflags.m4
>> @@ -15,7 +15,7 @@ for ldflag in $APPEND_LIB
>> do
>>     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
>> done
>> -if [ ! -z $EXTRA_PREFIX ]; then
>> +if test ! -z $EXTRA_PREFIX ; then
>>     CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
>>     LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
>> fi
> 
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

> 
> My bad, I assume [] is expanded by m4, as that seems to be part of the
> language?
> 
> Thanks, Roger.
Wei Liu May 22, 2020, 11:41 a.m. UTC | #8
On Fri, May 22, 2020 at 11:40:06AM +0000, Bertrand Marquis wrote:
> 
> 
> > On 22 May 2020, at 12:19, Roger Pau Monné <roger.pau@citrix.com> wrote:
> > 
> > On Fri, May 22, 2020 at 10:05:53AM +0100, Wei Liu wrote:
> >> On Fri, May 22, 2020 at 08:41:17AM +0000, Bertrand Marquis wrote:
> >>> Hi,
> >>> 
> >>> As a consequence of this fix, the following has been committed (I guess as a consequence of regenerating the configure scripts):
> >>> diff --git a/tools/configure b/tools/configure
> >>> index 375430df3f..36596389b8 100755
> >>> --- a/tools/configure
> >>> +++ b/tools/configure
> >>> @@ -4678,6 +4678,10 @@ for ldflag in $APPEND_LIB
> >>> do
> >>>     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
> >>> done
> >>> +if  ! -z $EXTRA_PREFIX ; then
> >>> +    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
> >>> +    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> >>> +fi
> >>> CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
> >>> LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS”
> >>> 
> >>> This should be:
> >>> if  [ ! -z $EXTRA_PREFIX ]; then
> >>> 
> >>> As on other configure scripts.
> >>> 
> >>> During configure I have not the following error:
> >>> ./configure: line 4681: -z: command not found
> >>> 
> >>> Which is ignored but is adding -L/lib and -I/include to the CPPFLAGS and LDFLAGS
> >>> 
> >>> What should be the procedure to actually fix that (as the problem is coming from the configure script regeneration I guess) ? 
> >> 
> >> Does the following patch work for you?
> >> 
> >> diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
> >> index 08f5c983cc63..cd34c139bc94 100644
> >> --- a/m4/set_cflags_ldflags.m4
> >> +++ b/m4/set_cflags_ldflags.m4
> >> @@ -15,7 +15,7 @@ for ldflag in $APPEND_LIB
> >> do
> >>     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
> >> done
> >> -if [ ! -z $EXTRA_PREFIX ]; then
> >> +if test ! -z $EXTRA_PREFIX ; then
> >>     CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
> >>     LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
> >> fi
> > 
> > Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Thanks. I will transfer your tag to the proper patch I just sent.

Wei.

Patch
diff mbox series

diff --git a/m4/set_cflags_ldflags.m4 b/m4/set_cflags_ldflags.m4
index cbad3c10b0..08f5c983cc 100644
--- a/m4/set_cflags_ldflags.m4
+++ b/m4/set_cflags_ldflags.m4
@@ -15,6 +15,10 @@  for ldflag in $APPEND_LIB
 do
     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
 done
+if [ ! -z $EXTRA_PREFIX ]; then
+    CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
+    LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
+fi
 CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
 LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS"])