| 1 | = NetBSD Build Page = |
| 2 | |
| 3 | My first try at building ossim (OSSIM060711 snapshot) on NetBSD-2.1-STABLE made me run into some obstacles. |
| 4 | This is not a complete and final instruction, but just a hint on what to expect. |
| 5 | |
| 6 | * make vs. gmake (GNU make) issues |
| 7 | * gcvt() legacy function |
| 8 | * values.h legacy(?) header file |
| 9 | |
| 10 | First I used the following configure parameters: |
| 11 | |
| 12 | ./configure --prefix=/usr/pkg --with-libtiff=/usr/pkg --with-jpeg=/usr/pkg --with-geotiff=no --with-openthreads=no |
| 13 | |
| 14 | The (previously installed) tiff and jpeg libraries from the NetBSD pkgsrc are recognized and used. |
| 15 | |
| 16 | <hr> |
| 17 | |
| 18 | On NetBSD (as on other BSDs AFAIK) the GNU make utility's name is <code>gmake</code>. |
| 19 | Most of the Makefiles created in the ./configure stage make use of the |
| 20 | variable $(MAKE) to overcome this difference, i.e. they correctly call <code>gmake</code> |
| 21 | again, when you invoked the top level Makefile with <code>gmake</code>. |
| 22 | |
| 23 | In the ossim/src/Makefile, however, the first target reads |
| 24 | apps: libs |
| 25 | (cd apps; make all; ) |
| 26 | |
| 27 | I just replaced <code>make</code> with <code>$(MAKE)</code> to continue. |
| 28 | I believe there's another one or two places in the top level Makefile or Makefile.common, |
| 29 | where make is used instead of $(MAKE) |
| 30 | |
| 31 | <hr> |
| 32 | |
| 33 | The gcvt(3) function seems to be a Linux (e.g. http://www.die.net/doc/linux/man/man3/gcvt.3.html) and |
| 34 | Mac OSX (e.g. http://www.hmug.org/man/3/gcvt.php) legacy function. Both man pages tell the function |
| 35 | is to be obsoleted. The MacOS X man page has a note on how to replace the function by snprintf(3), |
| 36 | the Linux man page suggests sprintf(3)... I decided for myself to prefer snprintf(3). |
| 37 | |
| 38 | I changed the two instances of gcvt() calls in ossim/src/ossim/vpfutil/vpfdisp.c |
| 39 | |
| 40 | line 411: |
| 41 | - gcvt(f,6,num) |
| 42 | + snprintf(num,20,"%6g",f); |
| 43 | line 427: |
| 44 | - gcvt(fptr[j],6,num); |
| 45 | + snprintf(num,20,"%6g",fptr[j]); |
| 46 | |
| 47 | I don't yet know if this change is adequately reflecting what gcvt() is supposed to do. |
| 48 | The 20 as max. length of the string is the number of characters allocated for num; the constant 20 better |
| 49 | had been replaced by a macro <code>#define MAXNUMLEN 20</code> or similiar in all places. |
| 50 | |
| 51 | <hr> |
| 52 | |
| 53 | The values.h file seems to be required to pull in some machine specific |
| 54 | constants. On NetBSD I tried to simply include limits.h instead, and I |
| 55 | saw neither a warning nor an error. |
| 56 | |
| 57 | I changed file ossim/src/ossim/vpfutil/vpfcntnt.c line 28 to |
| 58 | {{{ |
| 59 | # include <limits.h> |
| 60 | }}} |
| 61 | |
| 62 | After these changes I was at least able to build the ossim libraries and binaries, |
| 63 | and I am right now trying to get ossim_qt to work. |