[GRASS5] [bug #2543] (grass) patches to build on openbsd without tcl/tk

Request Tracker grass-bugs at intevation.de
Sun Jul 18 09:49:51 EDT 2004


this bug's URL: http://intevation.de/rt/webrt?serial_num=2543
-------------------------------------------------------------------------

Subject: patches to build on openbsd without tcl/tk

Platform: other
grass binary for platform: Compiled from Sources
GRASS Version: 5.7.0

My platform is: OpenBSD/3.4 i386
configure args were: 
 --with-gdal=no
 --with-tcltk=no
 --with-postgres=no
 --with-odbc=no
 --with-motif=no
 --with-opengl=no
+ the path options for (proj png jpeg tiff).

1. because make is BSD make here, and GNU make is installed as gmake, i had to make these changes:

--- Makefile.orig       Sun Jul 18 19:22:28 2004
+++ Makefile    Sun Jul 18 19:22:38 2004
@@ -29,7 +29,7 @@

 # Shell commands
 MAKE_DIR_CMD=          mkdir -p -m 755
-MAKE=                  make
+#MAKE=                 make
 INSTALL=               cp


--- include/Make/Platform.make.in.orig  Sun Jul 18 19:15:29 2004
+++ include/Make/Platform.make.in       Sun Jul 18 19:15:40 2004
@@ -27,7 +27,7 @@
 LEX                 = @LEX@
 YACC                = @YACC@
 PERL                = @PERL@
-MAKE                = make
+#MAKE                = make
 AR                  = @AR@
 RANLIB              = @RANLIB@
 MKDIR               = mkdir -p
--- vector/v.clean/Makefile.orig        Sun Jul 18 23:16:08 2004
+++ vector/v.clean/Makefile     Sun Jul 18 23:16:21 2004
@@ -13,4 +13,4 @@
 default: cmd ctest

 ctest:
-       cd test; make
+       cd test && $(MAKE)


2. also there were some assumptions about OGR which caused link errors

--- lib/vector/Vlib/close.c.orig        Sun Jul 18 22:46:32 2004
+++ lib/vector/Vlib/close.c     Sun Jul 18 22:46:59 2004
@@ -61,8 +61,10 @@
        Vect_save_spatial_index ( Map );
        Vect_cidx_save ( Map );

+#ifdef HAVE_OGR
        if ( Map->format == GV_FORMAT_OGR )
            V2_close_ogr ( Map );
+#endif
     }

     if ( Map->level == 2 ) {
--- lib/vector/Vlib/open.c.orig Sun Jul 18 22:47:19 2004
+++ lib/vector/Vlib/open.c      Sun Jul 18 22:47:53 2004
@@ -211,6 +211,7 @@
              level = 1;
          }
       }
+#ifdef HAVE_OGR
       /* Open OGR specific support files */
       if ( level == 2 && Map->format == GV_FORMAT_OGR ) {
          if ( V2_open_old_ogr ( Map ) < 0 ) {
@@ -220,6 +221,7 @@
              level = 1;
          }
       }
+#endif
       if (level_request == 2 && level < 2) {
          sprintf ( errmsg, "Cannot open old vector %s on level %d", Vect_get_fu
ll_name(Map), level_request );
          fatal_error (ferror, errmsg);


3. i couldn't figure out how the shared library stuff was figured out. whatever configure detected was just totally broken. so in the end i modified the Shlib.make to use gcc's -shared argument. i don't know how to fix this properly (it is a hard problem. maybe use libtool?)

--- include/Make/Shlib.make.orig        Sun Jul 18 20:29:06 2004
+++ include/Make/Shlib.make     Sun Jul 18 20:30:18 2004
@@ -5,7 +5,7 @@
 LDFLAGS += $(SHLIB_LDFLAGS)

 $(SHLIB): $(SHLIB_OBJS)
-       $(CC) $(LDFLAGS) $(LD_SEARCH_FLAGS) $(SHLIB_LD) $(EXTRA_LIBDIRS) $(LIBDI
RS) $(TOOLS_LIBDIRS) \
+       $(CC) -shared $(LDFLAGS) $(EXTRA_LIBDIRS) $(LIBDIRS) $(TOOLS_LIBDIRS) \
                $(SHLIB_OBJS) $(EXTRA_LIBS) -o $@

 shlib: $(SHLIB)


there are other probs with tcl/tk assumptions, but i think i will just install it instead of trying to figure out how to exclude some modules.

cheers

-------------------------------------------- Managed by Request Tracker




More information about the grass-dev mailing list