Skip to content

Commit

Permalink
Merge pull request NCAR#119 from tenomoto/develop
Browse files Browse the repository at this point in the history
enable build on FreeBSD
  • Loading branch information
khallock authored Dec 21, 2019
2 parents 85bce0e + 0e54eed commit 266164f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
18 changes: 11 additions & 7 deletions config/FreeBSD
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,27 @@
*/

#define HdfDefines -DFreeBSD
#define StdDefines -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped
#define StdDefines -DSYSV -D_XOPEN_SOURCE -DByteSwapped -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#define ByteSwapped
#define Cstatic
#define Cdynamic
#define CppCommand '/usr/bin/cpp -traditional'
#define CCompiler cc
#define FCompiler f77
#define CtoFLibraries -lg2c -lgcc -lm
#define CcOptions -ansi
#define CxxCompiler c\+\+
#define FCompiler gfortran9
#define CtoFLibraries -L/usr/local/lib/gcc9 -lgfortran -lquadmath
#define FcOptions -fno-range-check -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables
#define CcOptions -fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -fno-unwind-tables
#define COptimizeFlag -O2
#define FOptimizeFlag -O2
#define XToolLibrary -lXt -lSM -lICE
#define BuildShared NO
#define XLibrary -lX11 -lXext

#define ArchRecLibSearch -L/usr/X11R6/lib -L/usr/local/lib
#define ArchRecIncSearch -I/usr/X11R6/include -I/usr/local/include
#define ArchRecLibSearch -L/usr/local/lib
#define ArchRecIncSearch -I/usr/local/include -I/usr/local/include/freetype2

FC ?= $(F77)
FC = /usr/local/bin/gfortran9

/*************** Redefine Macros from Rules ********************************/

Expand Down
1 change: 1 addition & 0 deletions config/ymake
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ case FreeBSD:
switch ("$mach")
case i*86:
case i*64:
case amd64:
case alpha:
set model = $mach
set arch = $mach
Expand Down
5 changes: 1 addition & 4 deletions ncarview/src/bin/ictrans/yMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DEP_LIBS = $(DEPICTRANSLIB) $(DEPCTRANSLIB) $(DEPCGMLIB) \
MORE_LIBS = -lmalloc
#endif

EXTRA_LIBS = $(X11LIBS) $(SUNLIBS) $(NETCDFLIB) $(HDFLIB) $(CTOFLIBS)
EXTRA_LIBS = $(X11LIBS) $(SUNLIBS) $(NETCDFLIB) $(HDFLIB) $(CTOFLIBS) -lm
SYS_LIBS = $(MORE_LIBS)

SRCS = main.c
Expand All @@ -40,9 +40,6 @@ OBJS = main.o
CProgram($(MYNAME),$(OBJS),$(DEP_LIBS))
DependTarget($(SRCS))

all-local::
@$(CAT) Copyright

lint: $(HDR) $(SRCS)
lint $(CDEFINES) $(LINTLIBS) $(SRCS) 1> lint.out 2>&1
# lint $(SRCS) $(LIBS) > lint.out
4 changes: 4 additions & 0 deletions ni/src/ncl/FileSupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ short NCLuseAFS;

#include <ctype.h>
#include <unistd.h>
#ifdef __FreeBSD__
#include <stdlib.h>
#else
#include <alloca.h>
#endif
#include <netcdf.h>

#ifdef BuildHDF4
Expand Down
4 changes: 4 additions & 0 deletions ni/src/ncl/NclAdvancedFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
#include <sys/stat.h>
#include <assert.h>
#include <math.h>
#ifdef __FreeBSD__
#include <stdlib.h>
#else
#include <alloca.h>
#endif
#include "defs.h"
#include "Symbol.h"
#include "NclVar.h"
Expand Down

0 comments on commit 266164f

Please sign in to comment.