[Gdal-dev] SVN main trunk compilation woes on FreeBSD

Tom Russo russo at bogodyn.org
Tue Nov 6 18:31:26 EST 2007


I had a few problems getting gdal from svn head to compile on BSD this weekend.
It's been a long time since I've updated gdal (I think the last time was 
somewhere around a recent release, but still off the svn version), and I use
the python bindings.

My configure line was:


./configure --without-libgrass --without-grass --with-local=/usr/local --with-python 

This gets me (ultimately) the configure output:

GDAL is now configured for i386-unknown-freebsd6.3

  Installation directory:    /usr/local
  C compiler:                gcc -O2 
  C++ compiler:              g++ -O2 

  LIBTOOL support:           yes

  LIBZ support:              external
  GRASS support:             no
  CFITSIO support:           no
  PCRaster support:          internal
  NETCDF support:            yes
  LIBPNG support:            external
  LIBTIFF support:           external (BigTIFF=no)
  LIBGEOTIFF support:        external
  LIBJPEG support:           external
  LIBGIF support:            internal
  OGDI support:              yes
  HDF4 support:              no
  HDF5 support:              no
  KAKADU support:            no
  JASPER support:            yes (GeoJP2=no)
  ECW support:               no
  MrSID support:             no
  GRIB support:              no
  CURL support (wms/wcs/...):yes
  POSTGRESQL support:        yes
  MySQL support:             no
  XERCES support:            no
  Expat support:             no
  ODBC support:              no
  PGEO support:              no
  OCI support:               no
  SDE support:               no
  DODS support:              no
  SQLite support:            no
  DWGdirect support          no
  PANORAMA GIS support:      no
  INFORMIX DataBlade support:no
  GEOS support:              yes


  Old-gen python          no
  SWIG Bindings:          python 

  Statically link PROJ.4:    no
  enable OGR building:       yes
  enable pthread support:    no
  enable debug mode:         no
  hide internal symbols:     no


But when I build I get a ton of errors like:
libtool_args+=: not found
compile_command+=: not found
finalize_command+=: not found
libtool_args+=: not found
libtool_args+=: not found
compile_command+=: not found
finalize_command+=: not found
libtool_args+=: not found
compile_command+=: not found
finalize_command+=: not found

and finally:

libtool: link: g++  /users/russo/src/gdal/.libs/libgdal.so -L/usr/local/lib /usr/local/lib/libgeos_c.so /usr/local/lib/libgeos.so /usr/local/lib/libjasper.so -logdi31 -lgeotiff /usr/local/lib/libtiff.so -lm /usr/local/lib/libjpeg.so -lpng /usr/local/lib/libnetcdf.so -lpq /usr/local/lib/libcurl.so -lssl -lcrypto -lz -Wl,-rpath -Wl,/usr/local/lib
/usr/lib/crt1.o(.text+0x72): In function `_start':
: undefined reference to `main'

In the end I simply took the path of least resistance and use 
"--without-libtool" to get past linker errors.  I have no idea how to proceed
with libtool here, but I can live without it.

The other problem was that when built with the new python bindings I got a 
make error ("don't know how to make build").  Building with --with-ogpython
worked.

Turns out the second problem is very simple to fix, and I'm attaching the patch.
FreeBSD does not have GNU Make as its default "make" program, you need to use
"gmake" to build gdal.  But the swig GNUMakefile has a hard coded "make build"
(among other things) in its rules, where it should have "$(MAKE) build" so that
the actual make program in use gets propagated downward.  With this attached
patch, I can build gdal on FreeBSD with the configure line:

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick
-------------- next part --------------
Index: swig/GNUmakefile
===================================================================
--- swig/GNUmakefile	(revision 12615)
+++ swig/GNUmakefile	(working copy)
@@ -17,16 +17,16 @@
 dist: generate
 
 clean:
-	for dir in ${BINDINGS}; do (cd $$dir; make clean ); done
+	for dir in ${BINDINGS}; do (cd $$dir; $(MAKE) clean ); done
 
 veryclean:
-	for dir in ${ALL_BINDINGS}; do (cd $$dir; make veryclean ); done
+	for dir in ${ALL_BINDINGS}; do (cd $$dir; $(MAKE) veryclean ); done
 
 generate:
-	for dir in ${ALL_BINDINGS}; do (cd $$dir; make generate ); done
+	for dir in ${ALL_BINDINGS}; do (cd $$dir; $(MAKE) generate ); done
 
 build:
-	for dir in ${BINDINGS}; do (cd $$dir; make build ); done
+	for dir in ${BINDINGS}; do (cd $$dir; $(MAKE) build ); done
 
 install:
-	for dir in ${BINDINGS}; do (cd $$dir; make install ); done
+	for dir in ${BINDINGS}; do (cd $$dir; $(MAKE) install ); done


More information about the gdal-dev mailing list