[Gdal-dev] compiling gdal from CVS on solaris

Frank Warmerdam warmerdam at pobox.com
Thu Oct 7 09:21:06 EDT 2004


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.

BTW, do you know what the -DPIC is supposed to accomplish?  I have never
seen a need for that before.

> 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

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 set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list