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

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

On Sun, 18 Jul 2004, Request Tracker wrote:

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

Already done in latest CVS (several weeks ago)

--- 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

This was already done also

--- 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)

This one I have done just now. The test directory is always going to be there so I'm not sure if && rather than ; is necessary: to err on the side of caution I left it as it was and just changed make to $(MAKE)

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

Will leave those to Radim to decide

[...]

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?)

The aim is not to have to use libtool. The shared library compile flag detection originally came from the Tcl source tree (and had some bugs); last week it was updated to a more recent version so hopefully the problems
you had will be solved in the latest CVS. Please try.

Paul K

Fixed.

Radim

On Sunday 18 July 2004 15:49, Request Tracker wrote:

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);