wiki:NetBSDBuild

Version 2 (modified by mlucas, 17 years ago) ( diff )

--

NetBSD Build Page

My first try at building ossim (OSSIM060711 snapshot) on NetBSD-2.1-STABLE made me run into some obstacles. This is not a complete and final instruction, but just a hint on what to expect.

  • make vs. gmake (GNU make) issues
  • gcvt() legacy function
  • values.h legacy(?) header file

First I used the following configure parameters:

  ./configure --prefix=/usr/pkg --with-libtiff=/usr/pkg --with-jpeg=/usr/pkg --with-geotiff=no --with-openthreads=no

The (previously installed) tiff and jpeg libraries from the NetBSD pkgsrc are recognized and used.

<hr>

On NetBSD (as on other BSDs AFAIK) the GNU make utility's name is <code>gmake</code>. Most of the Makefiles created in the ./configure stage make use of the variable $(MAKE) to overcome this difference, i.e. they correctly call <code>gmake</code> again, when you invoked the top level Makefile with <code>gmake</code>.

In the ossim/src/Makefile, however, the first target reads

  apps: libs
    (cd apps; make all; )

I just replaced <code>make</code> with <code>$(MAKE)</code> to continue. I believe there's another one or two places in the top level Makefile or Makefile.common, where make is used instead of $(MAKE)

<hr>

The gcvt(3) function seems to be a Linux (e.g. http://www.die.net/doc/linux/man/man3/gcvt.3.html) and Mac OSX (e.g. http://www.hmug.org/man/3/gcvt.php) legacy function. Both man pages tell the function is to be obsoleted. The MacOS X man page has a note on how to replace the function by snprintf(3), the Linux man page suggests sprintf(3)... I decided for myself to prefer snprintf(3).

I changed the two instances of gcvt() calls in ossim/src/ossim/vpfutil/vpfdisp.c

  line 411:
  -    gcvt(f,6,num)
  +    snprintf(num,20,"%6g",f);
  line 427:
  -    gcvt(fptr[j],6,num);
  +    snprintf(num,20,"%6g",fptr[j]);

I don't yet know if this change is adequately reflecting what gcvt() is supposed to do. The 20 as max. length of the string is the number of characters allocated for num; the constant 20 better had been replaced by a macro <code>#define MAXNUMLEN 20</code> or similiar in all places.

<hr>

The values.h file seems to be required to pull in some machine specific constants. On NetBSD I tried to simply include limits.h instead, and I saw neither a warning nor an error.

I changed file ossim/src/ossim/vpfutil/vpfcntnt.c line 28 to

 #   include <limits.h>

After these changes I was at least able to build the ossim libraries and binaries, and I am right now trying to get ossim_qt to work.

Note: See TracWiki for help on using the wiki.