Bug 126397 - graphics/libgeotiff fails to build
Summary: graphics/libgeotiff fails to build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pav Lucistnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-09 16:30 UTC by Michael Harnois
Modified: 2008-08-22 22:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Harnois 2008-08-09 16:30:01 UTC
===>  Building for libgeotiff-1.2.5
cd ./bin; make
cc -O2 -fno-strict-aliasing -pipe -march=athlon64 -L/usr/local/lib -I/usr/local/include -fPIC -Wall -I. -I.. -I/usr/local/include -c listgeo.c
In file included from listgeo.c:12:
./geo_simpletags.h:38: error: expected ')' before '*' token
listgeo.c: In function 'main':
listgeo.c:92: warning: implicit declaration of function 'GTIFNewSimpleTags'
listgeo.c:92: warning: assignment makes pointer from integer without a cast
*** Error code 1

Stop in /usr/ports/graphics/libgeotiff/work/libgeotiff-1.2.5/bin.
*** Error code 1

Stop in /usr/ports/graphics/libgeotiff/work/libgeotiff-1.2.5.
*** Error code 1

Stop in /usr/ports/graphics/libgeotiff.

How-To-Repeat: cd /usr/ports/graphics/libgeotiff && make
Comment 1 Thomas Russo 2008-08-14 16:48:19 UTC
I, too, found libgeotif 1.2.4 failed to upgrade to 1.2.5 with an error
on FreeBSD-6-STABLE.  The error message was slightly different here:

 In file included from listgeo.c:12:
 ../geo_simpletags.h:38: error: syntax error before '*' token
 listgeo.c: In function `main':
 listgeo.c:92: warning: implicit declaration of function `GTIFNewSimpleTags'
 listgeo.c:92: warning: assignment makes pointer from integer without a cast

but this is clearly the same problem.

The issue is that listgeo.h does not include "geo_tiffp.h" before including
"geo_simpletags.hf".  This leads to TIFFMethod not being defined before it 
is used as a type in line 38 of geo_simpletags.h

Adding 

  #include "geo_tiffp.h"

on the line prior to the one that includes geo_simpletags.h in
bin/listgeo.c gets one past the compilation error.  On my system,
however, this then leads to a link failure because the link line
includes a -L/usr/local/lib that it shouldn't:

cc -O2 -fno-strict-aliasing -pipe -L/usr/local/lib -I/usr/local/include -Wall listgeo.o -L/lib -L.. -lgeotiff -L/usr/local/lib -lproj -L/usr/local/lib -ltiff -lz  -lm  -L/usr/local -ljpeg -o listgeo
listgeo.o(.text+0x37d): In function `main':
: undefined reference to `ST_Create'
listgeo.o(.text+0x3be): In function `main':
: undefined reference to `ST_SetKey'
listgeo.o(.text+0x42e): In function `main':
: undefined reference to `ST_SetKey'
listgeo.o(.text+0x44c): In function `main':
: undefined reference to `ST_SetKey'
listgeo.o(.text+0x47a): In function `main':
: undefined reference to `ST_SetKey'
listgeo.o(.text+0x48f): In function `main':
: undefined reference to `GTIFNewSimpleTags'
listgeo.o(.text+0x4f4): In function `main':
: undefined reference to `ST_Destroy'

The problem *here* is the first "-L/usr/local/lib" on the link line,
which causes the linker to use my previously installed libgeotiff.a
(which doesn't contain the new "simpletags" stuff introduced in this
release of libgeotiff).  The reason *that's* happening is that
-L/usr/local/lib is being placed into CFLAGS by configure for some reason.
That's just plain wrong, because linker flags don't belong in CFLAGS.  This
is an issue with how the libgeotiff configure script is set up.

This is all stuff that should probably be fed upstream to the
libgeotiff authors.
Comment 2 Thomas Russo 2008-08-14 22:22:16 UTC
On further analysis, the problem is entirely due to the presence in
CFLAGS of -L/usr/local/lib and -I/usr/local/include, and a prior
installation of libgeotiff.  These CFLAGS cause the compilation of
listgeo.c to use the previously installed header files.

"geotiff.h" in 1.2.5 has the right definitions to allow
geo_simpletags.h to be included without error and without a previous
include of geo_tiffp.h.  In 1.2.4 the definition of TIFFMethod is in
geo_tiffp.h.  Including 1.2.4's geotiff.h in 1.2.5's listgeo.c gets it all
wrong.

So one can install libgeotiff just fine as long as there is no previous 
installation.  Upgrading is a problem because the CFLAGS and other
flags variables are set up so that the previous installation's headers and
libraries are used instead of the ones appropriate for the new code.

I was able to get 1.2.5 installed by deinstalling my 1.2.4 libgeotiff
and starting from scratch.

Unfortunately, I have no patch to provide to help with the upgrade
problem.  Somehow the makefile needs to be massaged so that the build
uses the headers in the current source code instead of
/usr/local/include, and similarly with libraries.
Comment 3 dfilter service freebsd_committer freebsd_triage 2008-08-22 12:51:13 UTC
pav         2008-08-22 11:50:59 UTC

  FreeBSD ports repository

  Modified files:
    graphics/libgeotiff  Makefile 
  Log:
  - Does not need these CFLAGS to build
  
  PR:             ports/126397 (related to)
  Reported by:    Michael Harnois <mdharnois@gmail.com>
  
  Revision  Changes    Path
  1.8       +0 -2      ports/graphics/libgeotiff/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Pav Lucistnik freebsd_committer freebsd_triage 2008-08-22 13:01:40 UTC
State Changed
From-To: open->feedback

Please update your ports collection, verify you have 
graphics/libgeotiff/Makefile rev. 1.8, and test if the problem still exists. 


Comment 5 Pav Lucistnik freebsd_committer freebsd_triage 2008-08-22 13:01:40 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav

Please update your ports collection, verify you have 
graphics/libgeotiff/Makefile rev. 1.8, and test if the problem still exists.
Comment 6 Pav Lucistnik freebsd_committer freebsd_triage 2008-08-22 22:32:29 UTC
State Changed
From-To: feedback->closed

Reported fixed by submitter