[GRASS-dev] [GRASS GIS] #467: Wrong detection on cairo

#467: Wrong detection on cairo
-----------------------+----------------------------------------------------
Reporter: fundawang | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: 6.4.0 RCs
Keywords: | Platform: Linux
      Cpu: All |
-----------------------+----------------------------------------------------
in configure.in:

{{{
ac_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS $CAIROLIB"
AC_CHECK_FUNC(cairo_create,[
AC_MSG_ERROR([*** Unable to locate cairo_create() function.])
])
LDFLAGS=${ac_save_ldflags}
}}}

but CAIROLIB is a library, not a linker flag. as Mandriva will use
LDFLAGS="-Wl,--as-needed" by default, such a wrong link order will make it
impossible to test the program:
{{{
gcc -o conftest -Wl,--as-needed -lcairo conftest.c
}}

It will produces: undefined reference to `cairo_create', because -lcairo
is considered as objects, rather than libs.

You should change ldflags to LIBS.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/467&gt;
GRASS GIS <http://grass.osgeo.org>

#467: Wrong detection on cairo
------------------------+---------------------------------------------------
  Reporter: fundawang | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: All
------------------------+---------------------------------------------------
Comment (by glynn):

Replying to [ticket:467 fundawang]:

> It will produces: undefined reference to `cairo_create', because -lcairo
is considered as objects, rather than libs.
>
> You should change ldflags to LIBS.

FWIW, 7.0 uses LIBS via LOC_CHECK_FUNC.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/467#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#467: Wrong detection on cairo
------------------------+---------------------------------------------------
  Reporter: fundawang | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: All
------------------------+---------------------------------------------------
Comment (by neteler):

The 7 code is here:
http://trac.osgeo.org/grass/browser/grass/trunk/configure.in#L1409

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/467#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#467: Wrong detection on cairo
------------------------+---------------------------------------------------
  Reporter: fundawang | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: All
------------------------+---------------------------------------------------
Comment (by fundawang):

I think I'm talking about 6.4x

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/467#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#467: Wrong detection on cairo
------------------------+---------------------------------------------------
  Reporter: fundawang | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: All
------------------------+---------------------------------------------------
Comment (by fundawang):

still valid for 6.4 rc4

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/467#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#467: Wrong detection on cairo
------------------------+---------------------------------------------------
  Reporter: fundawang | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: All
------------------------+---------------------------------------------------
Comment (by fundawang):

ping??

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/467#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#467: Wrong detection on cairo
------------------------+---------------------------------------------------
  Reporter: fundawang | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.4.0 RCs
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: All
------------------------+---------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * resolution: => fixed

Comment:

Fixed in 6.5.svn (r36869) and 6.4.0svn (r36870) for the 6.4.0final.

Thanks for the patch.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/467#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>