Created
June 16, 2013 17:04
-
-
Save schwehr/5792674 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ruN --exclude=.svn mb-system.orig/configure.in mb-system/configure.in | |
--- mb-system.orig/configure.in 2013-06-15 15:35:31.000000000 -0700 | |
+++ mb-system/configure.in 2013-06-16 08:47:02.000000000 -0700 | |
@@ -104,6 +104,13 @@ | |
AC_ARG_WITH(otps_dir, [ --with-otps_dir=DIR Location of OSU Tidal Prediction Software], [OTPS_DIR=${withval}]) | |
AC_SUBST(OTPS_DIR) | |
+AC_MSG_CHECKING([whether to build with Generic Sensor Format (GSF)]) | |
+AC_ARG_WITH([gsf], AS_HELP_STRING([--without-gsf], [Disable unlicensed SAIC Generic Sensor Format (GSF)]), [ ], [with_gsf=yes]) | |
+AC_MSG_RESULT([$with_gsf]) | |
+ | |
+AS_IF([test x"$with_gsf" = xyes], [AC_DEFINE(WITH_GSF, 1, [Build with GSF])]) | |
+AM_CONDITIONAL([BUILD_GSF], [test x"$with_gsf" = xyes]) | |
+ | |
dnl Check for NetCDF lib | |
echo "Check for NetCDF" | |
GOT_CDF=no | |
@@ -633,3 +640,6 @@ | |
echo "OpenGL Support: Disabled" | |
fi | |
echo "Using $OTPS_DIR for OSU Tidal Prediction Software" | |
+ | |
+AS_ECHO(["Build with Generic Sensor Format (GSF) Support: $with_gsf"]) | |
+ | |
diff -ruN --exclude=.svn mb-system.orig/src/Makefile.am mb-system/src/Makefile.am | |
--- mb-system.orig/src/Makefile.am 2013-06-15 15:35:30.000000000 -0700 | |
+++ mb-system/src/Makefile.am 2013-06-15 17:46:28.000000000 -0700 | |
@@ -4,4 +4,9 @@ | |
if BUILD_GL | |
XBUILD_SUB_GL = mbview | |
endif | |
-SUBDIRS = gsf surf mr1pr proj mbio mbaux utilities gmt otps macros $(XBUILD_SUB) $(XBUILD_SUB_GL) man html ps share | |
+if BUILD_GSF | |
+ XBUILD_SUB_GSF = gsf | |
+endif | |
+ | |
+SUBDIRS = $(XBUILD_SUB_GSF) surf mr1pr proj mbio mbaux utilities gmt otps macros $(XBUILD_SUB) $(XBUILD_SUB_GL) man html ps share | |
+ | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/Makefile.am mb-system/src/mbio/Makefile.am | |
--- mb-system.orig/src/mbio/Makefile.am 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/Makefile.am 2013-06-15 17:13:51.000000000 -0700 | |
@@ -13,7 +13,7 @@ | |
mbsys_ldeoih.h \ | |
mbsys_reson.h mbsys_sb2000.h \ | |
mbsys_hsmd.h mbsys_dsl.h \ | |
- mbsys_gsf.h mbsys_mstiff.h \ | |
+ mbsys_mstiff.h \ | |
mbsys_oic.h mbsys_hdcs.h \ | |
mbsys_singlebeam.h mbsys_xse.h \ | |
mbsys_hs10.h \ | |
@@ -38,11 +38,14 @@ | |
mbf_sbsioswb.h \ | |
mbf_hsmdaraw.h mbf_hsmdldih.h \ | |
mbf_dsl120pf.h mbf_dsl120sf.h \ | |
- mbf_gsfgenmb.h mbf_mstiffss.h \ | |
+ mbf_mstiffss.h \ | |
mbf_oicgeoda.h mbf_oicmbari.h \ | |
mbf_omghdcsj.h mbf_mgd77dat.h \ | |
mbf_mbarirov.h mbf_mbarrov2.h \ | |
mbf_mbpronav.h mbf_xtfr8101.h | |
+if BUILD_GSF | |
+ include_HEADERS += mbsys_gsf.h mbf_gsfgenmb.h | |
+endif | |
lib_LTLIBRARIES = libmbio.la | |
@@ -70,7 +73,7 @@ | |
mbsys_ldeoih.c mbsys_reson.c \ | |
mbsys_elac.c mbsys_elacmk2.c \ | |
mbsys_sb2000.c mbsys_hsmd.c mbsys_dsl.c \ | |
- mbsys_gsf.c mbsys_mstiff.c \ | |
+ mbsys_mstiff.c \ | |
mbsys_oic.c mbsys_hdcs.c \ | |
mbsys_singlebeam.c mbsys_xse.c \ | |
mbsys_hs10.c mbsys_atlas.c \ | |
@@ -100,7 +103,7 @@ | |
mbr_sb2000sb.c mbr_sb2000ss.c \ | |
mbr_hsmdaraw.c mbr_hsmdldih.c \ | |
mbr_dsl120pf.c mbr_dsl120sf.c \ | |
- mbr_gsfgenmb.c mbr_mstiffss.c \ | |
+ mbr_mstiffss.c \ | |
mbr_oicgeoda.c mbr_oicmbari.c \ | |
mbr_omghdcsj.c mbr_mgd77dat.c \ | |
mbr_asciixyz.c mbr_hydrob93.c \ | |
@@ -115,11 +118,16 @@ | |
mbr_hir2rnav.c mbr_hysweep1.c \ | |
mbr_xtfb1624.c mbr_swplssxi.c \ | |
mbr_swplssxp.c | |
- | |
+if BUILD_GSF | |
+ libmbio_la_SOURCES += mbsys_gsf.c mbr_gsfgenmb.c | |
+endif | |
libmbio_la_LIBADD = ${libnetcdf_LIBS} ${libgmt_LIBS} @XDR_LIB@ \ | |
- $(top_builddir)/src/gsf/libmbgsf.la $(top_builddir)/src/mr1pr/libmbmr1pr.la \ | |
+ $(top_builddir)/src/mr1pr/libmbmr1pr.la \ | |
$(top_builddir)/src/surf/libmbsapi.la $(top_builddir)/src/proj/libmbproj.la | |
+if BUILD_GSF | |
+ libmbio_la_LIBADD += $(top_builddir)/src/gsf/libmbgsf.la | |
+endif | |
nodist_libmbio_la_SOURCES = projections.h | |
@@ -130,4 +138,3 @@ | |
projections.h: Makefile | |
echo 'char *projectionfile = "$(mbsystemdatadir)/Projections.dat";' >$@ | |
-# echo 'char *projectionfile = "$(datadir)/mbsystem/Projections.dat";' >$@ | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mb_close.c mb-system/src/mbio/mb_close.c | |
--- mb-system.orig/src/mbio/mb_close.c 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mb_close.c 2013-06-15 17:30:44.000000000 -0700 | |
@@ -135,7 +135,9 @@ | |
#include "mb_io.h" | |
#include "mb_segy.h" | |
#include "../surf/sapi.h" | |
-#include "gsf.h" | |
+#ifdef WITH_GSF | |
+# include "gsf.h" | |
+#endif | |
#include "netcdf.h" | |
static char rcs_id[]="$Id: mb_close.c 2111 2013-06-07 02:28:59Z caress $"; | |
@@ -199,11 +201,13 @@ | |
status = mb_fileio_close(verbose, *mbio_ptr, error); | |
} | |
+#ifdef WITH_GSF | |
/* else if gsf then use gsfClose */ | |
else if (mb_io_ptr->filetype == MB_FILETYPE_GSF) | |
{ | |
gsfClose((int) mb_io_ptr->gsfid); | |
} | |
+#endif | |
/* else if netcdf then use nc_close */ | |
else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF) | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mb_config.h mb-system/src/mbio/mb_config.h | |
--- mb-system.orig/src/mbio/mb_config.h 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mb_config.h 1969-12-31 16:00:00.000000000 -0800 | |
@@ -1,124 +0,0 @@ | |
-/* src/mbio/mb_config.h. Generated from mb_config.h.in by configure. */ | |
-/* src/mbio/mb_config.h.in. Generated from configure.in by autoheader. */ | |
- | |
-/* Machine is littleendian, (Byteswapping on) */ | |
-#define BYTESWAPPED 1 | |
- | |
-/* Machine is bigendian, (Byteswapping off) */ | |
-/* #undef ENDIAN_BIG */ | |
- | |
-/* Turned on OpenGL define in config */ | |
-#define GOT_GL 1 | |
- | |
-/* Turned on Motif define in config */ | |
-#define GOT_MOTIF 1 | |
- | |
-/* Define to 1 if you have the <dlfcn.h> header file. */ | |
-#define HAVE_DLFCN_H 1 | |
- | |
-/* Define to 1 if you have the <GL/glu.h> header file. */ | |
-#define HAVE_GL_GLU_H 1 | |
- | |
-/* Define to 1 if you have the <GL/glx.h> header file. */ | |
-#define HAVE_GL_GLX_H 1 | |
- | |
-/* Define to 1 if you have the <GL/gl.h> header file. */ | |
-#define HAVE_GL_GL_H 1 | |
- | |
-/* Define to 1 if you have the <inttypes.h> header file. */ | |
-#define HAVE_INTTYPES_H 1 | |
- | |
-/* Define to 1 if you have the `m' library (-lm). */ | |
-#define HAVE_LIBM 1 | |
- | |
-/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ | |
-/* #undef HAVE_LIBWS2_32 */ | |
- | |
-/* Have malloc.h */ | |
-/* #undef HAVE_MALLOC_H */ | |
- | |
-/* Define to 1 if you have the <memory.h> header file. */ | |
-#define HAVE_MEMORY_H 1 | |
- | |
-/* Define to 1 if you have the <rpc/rpc.h> header file. */ | |
-#define HAVE_RPC_RPC_H 1 | |
- | |
-/* Define to 1 if you have the <rpc/types.h> header file. */ | |
-#define HAVE_RPC_TYPES_H 1 | |
- | |
-/* Define to 1 if you have the <stdint.h> header file. */ | |
-#define HAVE_STDINT_H 1 | |
- | |
-/* Define to 1 if you have the <stdlib.h> header file. */ | |
-#define HAVE_STDLIB_H 1 | |
- | |
-/* Define to 1 if you have the <strings.h> header file. */ | |
-#define HAVE_STRINGS_H 1 | |
- | |
-/* Define to 1 if you have the <string.h> header file. */ | |
-#define HAVE_STRING_H 1 | |
- | |
-/* Define to 1 if you have the <sys/stat.h> header file. */ | |
-#define HAVE_SYS_STAT_H 1 | |
- | |
-/* Define to 1 if you have the <sys/types.h> header file. */ | |
-#define HAVE_SYS_TYPES_H 1 | |
- | |
-/* Define to 1 if you have the <unistd.h> header file. */ | |
-#define HAVE_UNISTD_H 1 | |
- | |
-/* Define to the sub-directory in which libtool stores uninstalled libraries. | |
- */ | |
-#define LT_OBJDIR ".libs/" | |
- | |
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */ | |
-/* #undef NO_MINUS_C_MINUS_O */ | |
- | |
-/* Name of package */ | |
-#define PACKAGE "mbsystem" | |
- | |
-/* Define to the address where bug reports for this package should be sent. */ | |
-#define PACKAGE_BUGREPORT "" | |
- | |
-/* Define to the full name of this package. */ | |
-#define PACKAGE_NAME "mbsystem" | |
- | |
-/* Define to the full name and version of this package. */ | |
-#define PACKAGE_STRING "mbsystem 5.4.2123" | |
- | |
-/* Define to the one symbol short name of this package. */ | |
-#define PACKAGE_TARNAME "mbsystem" | |
- | |
-/* Define to the home page for this package. */ | |
-#define PACKAGE_URL "" | |
- | |
-/* Define to the version of this package. */ | |
-#define PACKAGE_VERSION "5.4.2123" | |
- | |
-/* Define to 1 if you have the ANSI C header files. */ | |
-#define STDC_HEADERS 1 | |
- | |
-/* Version number of package */ | |
-#define VERSION "5.4.2123" | |
- | |
-/* Set VERSION_DATE define in mb_config.h */ | |
-#define VERSION_DATE "10 June 2013" | |
- | |
-/* Turned on WIN32 define in config */ | |
-/* #undef WIN32 */ | |
- | |
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most | |
- significant byte first (like Motorola and SPARC, unlike Intel). */ | |
-#if defined AC_APPLE_UNIVERSAL_BUILD | |
-# if defined __BIG_ENDIAN__ | |
-# define WORDS_BIGENDIAN 1 | |
-# endif | |
-#else | |
-# ifndef WORDS_BIGENDIAN | |
-/* # undef WORDS_BIGENDIAN */ | |
-# endif | |
-#endif | |
- | |
-/* Define to the type of a signed integer type of width exactly 8 bits if such | |
- a type exists and the standard includes do not define it. */ | |
-/* #undef int8_t */ | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mb_config.h.in mb-system/src/mbio/mb_config.h.in | |
--- mb-system.orig/src/mbio/mb_config.h.in 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mb_config.h.in 2013-06-16 07:54:51.000000000 -0700 | |
@@ -1,4 +1,5 @@ | |
-/* src/mbio/mb_config.h.in. Generated from configure.in by autoheader. */ | |
+/* 0 to exclude libgsf. 1 to build with the Generic Sensor Format. */ | |
+#undef WITH_GSF | |
/* Machine is littleendian, (Byteswapping on) */ | |
#undef BYTESWAPPED | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mb_format.c mb-system/src/mbio/mb_format.c | |
--- mb-system.orig/src/mbio/mb_format.c 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mb_format.c 2013-06-15 17:49:00.000000000 -0700 | |
@@ -528,10 +528,12 @@ | |
{ | |
status = mbr_register_dsl120sf(verbose, mbio_ptr, error); | |
} | |
+#ifdef WITH_GSF | |
else if (*format == MBF_GSFGENMB) | |
{ | |
status = mbr_register_gsfgenmb(verbose, mbio_ptr, error); | |
} | |
+#endif | |
else if (*format == MBF_MSTIFFSS) | |
{ | |
status = mbr_register_mstiffss(verbose, mbio_ptr, error); | |
@@ -1263,6 +1265,7 @@ | |
beamwidth_xtrack, beamwidth_ltrack, | |
error); | |
} | |
+#ifdef WITH_GSF | |
else if (*format == MBF_GSFGENMB) | |
{ | |
status = mbr_info_gsfgenmb(verbose, system, | |
@@ -1274,6 +1277,7 @@ | |
beamwidth_xtrack, beamwidth_ltrack, | |
error); | |
} | |
+#endif | |
else if (*format == MBF_MSTIFFSS) | |
{ | |
status = mbr_info_mstiffss(verbose, system, | |
@@ -3282,6 +3286,7 @@ | |
} | |
} | |
+#ifdef WITH_GSF | |
/* look for a CARIS GSF export *.gsf format convention */ | |
if (found == MB_NO) | |
{ | |
@@ -3306,7 +3311,9 @@ | |
found = MB_YES; | |
} | |
} | |
+#endif | |
+#ifdef WITH_GSF | |
/* look for a SAIC GSF *.d0X format convention */ | |
if (found == MB_NO) | |
{ | |
@@ -3329,6 +3336,7 @@ | |
found = MB_YES; | |
} | |
} | |
+#endif | |
/* look for a Reson 7K multibeam *.s7k format convention */ | |
if (found == MB_NO) | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mb_format.h mb-system/src/mbio/mb_format.h | |
--- mb-system.orig/src/mbio/mb_format.h 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mb_format.h 2013-06-15 17:33:23.000000000 -0700 | |
@@ -575,7 +575,9 @@ | |
int mbr_register_hsmdldih(int verbose, void *mbio_ptr, int *error); | |
int mbr_register_dsl120pf(int verbose, void *mbio_ptr, int *error); | |
int mbr_register_dsl120sf(int verbose, void *mbio_ptr, int *error); | |
+#ifdef WITH_GSF | |
int mbr_register_gsfgenmb(int verbose, void *mbio_ptr, int *error); | |
+#endif | |
int mbr_register_mstiffss(int verbose, void *mbio_ptr, int *error); | |
int mbr_register_edgjstar(int verbose, void *mbio_ptr, int *error); | |
int mbr_register_edgjstr2(int verbose, void *mbio_ptr, int *error); | |
@@ -1506,6 +1508,7 @@ | |
double *beamwidth_xtrack, | |
double *beamwidth_ltrack, | |
int *error); | |
+#ifdef WITH_GSF | |
int mbr_info_gsfgenmb(int verbose, | |
int *system, | |
int *beams_bath_max, | |
@@ -1526,6 +1529,7 @@ | |
double *beamwidth_xtrack, | |
double *beamwidth_ltrack, | |
int *error); | |
+#endif | |
int mbr_info_mstiffss(int verbose, | |
int *system, | |
int *beams_bath_max, | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mb_io.h mb-system/src/mbio/mb_io.h | |
--- mb-system.orig/src/mbio/mb_io.h 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mb_io.h 2013-06-15 18:24:23.000000000 -0700 | |
@@ -187,13 +187,9 @@ | |
#ifndef MB_IO_DEF | |
#define MB_IO_DEF | |
-#ifndef MB_DEFINE_DEF | |
+#include "mb_config.h" | |
#include "mb_define.h" | |
-#endif | |
- | |
-#ifndef MB_STATUS_DEF | |
#include "mb_status.h" | |
-#endif | |
struct mb_io_ping_struct | |
{ | |
@@ -283,7 +279,11 @@ | |
last record read */ | |
long file3_bytes; /* number of bytes read from file */ | |
int ncid; /* netCDF datastream ID */ | |
+#ifdef WITH_GSF | |
int gsfid; /* GSF datastream ID */ | |
+#else | |
+ int _gsfid_placeholder; | |
+#endif | |
void *xdrs; /* XDR stream handle */ | |
void *xdrs2; /* XDR stream handle #2 */ | |
void *xdrs3; /* XDR stream handle #2 */ | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mb_read_init.c mb-system/src/mbio/mb_read_init.c | |
--- mb-system.orig/src/mbio/mb_read_init.c 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mb_read_init.c 2013-06-15 17:38:54.000000000 -0700 | |
@@ -210,7 +210,9 @@ | |
#include "mb_define.h" | |
#include "../surf/sapi.h" | |
#include "mb_segy.h" | |
-#include "gsf.h" | |
+#ifdef WITH_GSF | |
+# include "gsf.h" | |
+#endif | |
#include "netcdf.h" | |
static char rcs_id[]="$Id: mb_read_init.c 2083 2013-05-26 07:23:56Z caress $"; | |
@@ -337,7 +339,11 @@ | |
mb_io_ptr->file3_pos = 0; | |
mb_io_ptr->file3_bytes = 0; | |
mb_io_ptr->ncid = 0; | |
+#ifdef WITH_GSF | |
mb_io_ptr->gsfid = 0; | |
+#else | |
+ /* TODO: possibly set to -666 */ | |
+#endif | |
mb_io_ptr->xdrs = NULL; | |
mb_io_ptr->xdrs2 = NULL; | |
mb_io_ptr->xdrs3 = NULL; | |
@@ -644,6 +650,7 @@ | |
status = mb_fileio_open(verbose, *mbio_ptr, error); | |
} | |
+#ifdef WITH_GSF | |
/* else handle gsf files to be opened with gsflib */ | |
else if (mb_io_ptr->filetype == MB_FILETYPE_GSF) | |
{ | |
@@ -661,6 +668,9 @@ | |
*error = MB_ERROR_OPEN_FAIL; | |
} | |
} | |
+#else | |
+ /* TODO: should issue an error */ | |
+#endif | |
/* else handle netcdf files to be opened with libnetcdf */ | |
else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF) | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mb_write_init.c mb-system/src/mbio/mb_write_init.c | |
--- mb-system.orig/src/mbio/mb_write_init.c 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mb_write_init.c 2013-06-15 17:39:51.000000000 -0700 | |
@@ -185,7 +185,10 @@ | |
#include "mb_define.h" | |
#include "mb_segy.h" | |
#include "../surf/sapi.h" | |
-#include "../gsf/gsf.h" | |
+#ifdef WITH_GSF | |
+# include "gsf.h" | |
+#endif | |
+/* #include "../gsf/gsf.h" */ | |
#include "netcdf.h" | |
static char rcs_id[]="$Id: mb_write_init.c 2083 2013-05-26 07:23:56Z caress $"; | |
@@ -281,7 +284,9 @@ | |
mb_io_ptr->file3_pos = 0; | |
mb_io_ptr->file3_bytes = 0; | |
mb_io_ptr->ncid = 0; | |
+#ifdef WITH_GSF | |
mb_io_ptr->gsfid = 0; | |
+#endif | |
mb_io_ptr->xdrs = NULL; | |
mb_io_ptr->xdrs2 = NULL; | |
mb_io_ptr->xdrs3 = NULL; | |
@@ -573,6 +578,7 @@ | |
status = mb_fileio_open(verbose, *mbio_ptr, error); | |
} | |
+#ifdef WITH_GSF | |
/* else handle gsf files to be opened with gsflib */ | |
else if (mb_io_ptr->filetype == MB_FILETYPE_GSF) | |
{ | |
@@ -590,7 +596,9 @@ | |
*error = MB_ERROR_OPEN_FAIL; | |
} | |
} | |
- | |
+#else | |
+ /* TODO: issue an error with gsf files? */ | |
+#endif | |
/* else handle netcdf files to be opened with libnetcdf */ | |
else if (mb_io_ptr->filetype == MB_FILETYPE_NETCDF) | |
{ | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mbf_gsfgenmb.h mb-system/src/mbio/mbf_gsfgenmb.h | |
--- mb-system.orig/src/mbio/mbf_gsfgenmb.h 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mbf_gsfgenmb.h 2013-06-15 17:22:40.000000000 -0700 | |
@@ -61,9 +61,7 @@ | |
* reading and writing. | |
*/ | |
-#ifndef __GSF_H__ | |
#include "gsf.h" | |
-#endif | |
struct mbf_gsfgenmb_struct | |
{ | |
diff -ruN --exclude=.svn mb-system.orig/src/mbio/mbsys_gsf.h mb-system/src/mbio/mbsys_gsf.h | |
--- mb-system.orig/src/mbio/mbsys_gsf.h 2013-06-15 15:35:26.000000000 -0700 | |
+++ mb-system/src/mbio/mbsys_gsf.h 2013-06-15 17:26:18.000000000 -0700 | |
@@ -81,15 +81,9 @@ | |
* | |
*/ | |
-#ifndef __GSF_H__ | |
#include "gsf.h" | |
-#endif | |
-#ifndef _GSF_FT_H_ | |
#include "gsf_ft.h" | |
-#endif | |
-#ifndef _GSF_ENC_H_ | |
#include "gsf_enc.h" | |
-#endif | |
/* internal data structure */ | |
struct mbsys_gsf_struct | |
diff -ruN --exclude=.svn mb-system.orig/src/utilities/Makefile.am mb-system/src/utilities/Makefile.am | |
--- mb-system.orig/src/utilities/Makefile.am 2013-06-15 15:35:30.000000000 -0700 | |
+++ mb-system/src/utilities/Makefile.am 2013-06-15 17:53:08.000000000 -0700 | |
@@ -53,9 +53,16 @@ | |
AM_CFLAGS = ${libnetcdf_CFLAGS} ${libgmt_CFLAGS} | |
-AM_CPPFLAGS = -I@top_srcdir@/src/mbio -I@top_srcdir@/src/mbaux -I@top_srcdir@/src/gsf @CDF_INC_DIR@ @GMT_INC_DIR@ @FFTW_INC_DIR@ | |
+AM_CPPFLAGS = -I@top_srcdir@/src/mbio -I@top_srcdir@/src/mbaux @CDF_INC_DIR@ @GMT_INC_DIR@ @FFTW_INC_DIR@ | |
+if BUILD_GSF | |
+ AM_CPPFLAGS += -I@top_srcdir@/src/gsf | |
+endif | |
AM_LDFLAGS = -L$(top_builddir)/src/mbio -L$(top_builddir)/src/mbaux -L$(top_builddir)/src/gsf -L$(top_builddir)/src/mr1pr -L$(top_builddir)/src/proj -L$(top_builddir)/src/surf | |
+if BUILD_GSF | |
+ AM_LDFLAGS += -L$(top_builddir)/src/gsf | |
+endif | |
+ | |
LIBS = ${libnetcdf_LIBS} ${libgmt_LIBS} $(top_builddir)/src/mbio/libmbio.la | |
mbhsdump_SOURCES = mbhsdump.c | |
@@ -74,7 +81,10 @@ | |
mbprocess_LDADD = $(top_builddir)/src/mbaux/libmbaux.la | |
mbcopy_SOURCES = mbcopy.c | |
-mbcopy_LDADD = $(top_builddir)/src/gsf/libmbgsf.la | |
+# libmbiola.la already links against gsf if gsf is being built | |
+#if BUILD_GSF | |
+# mbcopy_LDADD = $(top_builddir)/src/gsf/libmbgsf.la | |
+#endif | |
mblist_SOURCES = mblist.c | |
diff -ruN --exclude=.svn mb-system.orig/src/utilities/mbcopy.c mb-system/src/utilities/mbcopy.c | |
--- mb-system.orig/src/utilities/mbcopy.c 2013-06-15 15:35:30.000000000 -0700 | |
+++ mb-system/src/utilities/mbcopy.c 2013-06-16 07:34:07.000000000 -0700 | |
@@ -204,7 +204,9 @@ | |
#include "mbsys_simrad.h" | |
#include "mbsys_simrad2.h" | |
#include "mbsys_ldeoih.h" | |
-#include "mbsys_gsf.h" | |
+#ifdef WITH_GSF | |
+# include "mbsys_gsf.h" | |
+#endif | |
#include "mbsys_hsds.h" | |
#include "mbsys_reson8k.h" | |
@@ -215,7 +217,9 @@ | |
#define MBCOPY_XSE_TO_ELACMK2 3 | |
#define MBCOPY_SIMRAD_TO_SIMRAD2 4 | |
#define MBCOPY_ANY_TO_MBLDEOIH 5 | |
-#define MBCOPY_RESON8K_TO_GSF 6 | |
+#ifdef WITH_GSF | |
+# define MBCOPY_RESON8K_TO_GSF 6 | |
+#endif | |
/* function prototypes */ | |
int setup_transfer_rules(int verbose, int ibeams, int obeams, | |
@@ -252,10 +256,12 @@ | |
char *comment, | |
void *ombio_ptr, void *ostore_ptr, | |
int *error); | |
+#ifdef WITH_GSF | |
int mbcopy_reson8k_to_gsf(int verbose, | |
void *imbio_ptr, | |
void *ombio_ptr, | |
int *error); | |
+#endif | |
static char rcs_id[] = "$Id: mbcopy.c 2063 2013-05-22 00:05:57Z caress $"; | |
@@ -733,13 +739,16 @@ | |
else if (pings == 1 | |
&& omb_io_ptr->format == MBF_MBLDEOIH) | |
copymode = MBCOPY_ANY_TO_MBLDEOIH; | |
+#ifdef WITH_GSF | |
else if (pings == 1 | |
&& imb_io_ptr->format == MBF_XTFR8101 | |
&& omb_io_ptr->format == MBF_GSFGENMB ) | |
copymode = MBCOPY_RESON8K_TO_GSF; | |
+#endif | |
else | |
copymode = MBCOPY_PARTIAL; | |
+#ifdef WITH_GSF | |
/* quit if an unsupported copy to GSF is requested */ | |
if (omb_io_ptr->format == MBF_GSFGENMB && copymode == MBCOPY_PARTIAL) | |
{ | |
@@ -749,6 +758,7 @@ | |
fprintf(stderr,"\tand contributing it to the MB-System community\n"); | |
exit(error); | |
} | |
+#endif | |
/* print debug statements */ | |
if (verbose >= 2) | |
@@ -1310,6 +1320,7 @@ | |
status = mbcopy_simrad_to_simrad2(verbose, | |
istore_ptr, ostore_ptr, &error); | |
} | |
+#ifdef WITH_GSF | |
else if (copymode == MBCOPY_RESON8K_TO_GSF | |
&& error == MB_ERROR_NO_ERROR) | |
{ | |
@@ -1318,6 +1329,7 @@ | |
status = mbcopy_reson8k_to_gsf(verbose, | |
imbio_ptr, ombio_ptr, &error); | |
} | |
+#endif | |
else if (copymode == MBCOPY_ANY_TO_MBLDEOIH | |
&& error == MB_ERROR_NO_ERROR) | |
{ | |
@@ -1414,7 +1426,9 @@ | |
case MBCOPY_SIMRAD_TO_SIMRAD2: | |
case MBCOPY_ELACMK2_TO_XSE: | |
case MBCOPY_XSE_TO_ELACMK2: | |
+#ifdef WITH_GSF | |
case MBCOPY_RESON8K_TO_GSF: | |
+#endif | |
status = mb_insert(verbose, ombio_ptr, ostore_ptr, | |
kind, time_i, time_d, | |
navlon, navlat, speed, heading, | |
@@ -3072,6 +3086,7 @@ | |
return(status); | |
} | |
/*--------------------------------------------------------------------*/ | |
+#ifdef WITH_GSF | |
int mbcopy_reson8k_to_gsf(int verbose, | |
void *imbio_ptr, | |
void *ombio_ptr, | |
@@ -3479,4 +3494,5 @@ | |
/* return status */ | |
return(status); | |
} | |
+#endif | |
/*--------------------------------------------------------------------*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment