[Gdal-dev] compiling gdal from CVS on solaris

Jeffery D. Collins jeff.collins at vexcel.com
Thu Oct 7 14:38:07 EDT 2004


Frank Warmerdam wrote:

> Jeffery D. Collins wrote:
>
>> Below are diffs (against CVS) necessary for compiling gdal on Solaris 
>> 8 using gcc (3.2.2).  There are likely better ways to solve these 
>> problems, and I may have broken something else without realizing it.  
>> Please point out my blunders:-)
>>
>> Had to build with: CFLAGS='-fPIC -DPIC' make
>
>
> Jeff,
>
> Did you use --without-libtool?  If you build with libtool, then libtool
> is supposed to take care of providing the -fPIC and any related 
> flags.  If
> you build without libtool, then configure should call the AC_COMPILER_PIC
> flag which would set the CXX_PIC and C_PIC macros.

No, I did not try this. 

>
> BTW, do you know what the -DPIC is supposed to accomplish?  I have never
> seen a need for that before.
>
No.  I saw it somewhere in a related build (proj, maybe?).  The build 
machine is pretty slow, so I tried to include everything that might 
possibly be necessary to avoid yet another rebuild.  

>> The change present in the first diff below was due to the compiler 
>> viewing CPPFLAGS as recursive.  The change in the second diff was due 
>> to the inability of the compiler to find jerror.h.  The final change 
>> failed to wrap OGR_G_Centroid in extern "C"{}.
>>
>>
>> Index: frmts/fit/GNUmakefile
>> ===================================================================
>> RCS file: /cvs/maptools/cvsroot/gdal/frmts/fit/GNUmakefile,v
>> retrieving revision 1.6
>> diff -r1.6 GNUmakefile
>> 7c7
>> < CPPFLAGS    =    $(GDAL_INCLUDE) $(XTRA_OPT) $(CPPFLAGS)
>> ---
>>
>>> CPPFLAGS    :=    $(GDAL_INCLUDE) $(XTRA_OPT) $(CPPFLAGS)
>>
>
> Yes, this is my fault - introduced yesterday afternoon.  I had to fix it
> in several other drivers as well I found.
>
>> Index: frmts/gtiff/libtiff/GNUmakefile
>> ===================================================================
>> RCS file: /cvs/maptools/cvsroot/gdal/frmts/gtiff/libtiff/GNUmakefile,v
>> retrieving revision 1.17
>> diff -r1.17 GNUmakefile
>> 44c44
>> < ALL_C_FLAGS    =    $(CFLAGS) -DZIP_SUPPORT -DPIXARLOG_SUPPORT 
>> -I../../zlib
>> ---
>>
>>> ALL_C_FLAGS    =    $(CFLAGS) -DZIP_SUPPORT -DPIXARLOG_SUPPORT 
>>> -I../../zlib 
>>
>>
>> -I../../../frmts/jpeg/libjpeg
>

This was due to a slightly broken jpeglib installation.  Apparently, 
jerror.h was missing from it.  This is no longer a problem.

>
> The GNUmakefile includes this statement:
>
> ifeq ($(JPEG_SETTING),internal)
> ALL_C_FLAGS     :=    $(ALL_C_FLAGS) -I../../jpeg/libjpeg
> endif
>
> This is supposed to add the gdal local libjpeg directory into the
> include path if building with an internal copy of libjpeg.  Otherwise
> we want to avoid forcing the use of the local libjpeg as the external
> one is presumably the one that is being linked with.  I imagine any
> include path for it should be in CPPFLAGS or GDAL_INCLUDE already.
>
> I have *not* applied this change, so if there is a real requirement we
> should discuss what is happening in more detail.


>
>> Index: ogr/ogr_api.h
>> ===================================================================
>> RCS file: /cvs/maptools/cvsroot/gdal/ogr/ogr_api.h,v
>> retrieving revision 1.20
>> diff -r1.20 ogr_api.h
>> 383a384,385
>>
>>> int OGR_G_Centroid( OGRGeometryH hPolygon, OGRGeometryH 
>>> hCentroidPoint );
>>
>
> Sorry about that ... I had done this but neglected to commit it.
>
> Best regards,


I updated my local copy from CVS, configured without libtool, recompiled 
and now everything works fine.  Thanks for the help!

-- 
Jeff





More information about the Gdal-dev mailing list