Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (45 sloc) 1.21 KB
#!/bin/sh
set -e
NETCDF_VERSION=netcdf-4.2.1.1
BASE="$( cd "$( dirname "$0" )" && pwd )"
BIN=$BASE/bin
SRC=$BASE/$NETCDF_VERSION
# Reset to known state
echo "# Resetting NetCDF sources to clean state"
cd $BASE
rm -rf $SRC
tar -zxvf $NETCDF_VERSION.tar.gz
cd $SRC
# Generate stdcall wrappers
echo
echo "# Generating stdcall wrappers"
runghc $BASE/mkstdcall.hs \
--exclude=$BASE/netcdf.ignore \
$SRC/include/netcdf.h > \
$SRC/liblib/stdcall.c
patch $SRC/liblib/Makefile.am $BASE/liblib-Makefile.am.patch
# Configure NetCDF
echo
echo "# Configuring NetCDF"
autoreconf -i
./configure --enable-dll --disable-netcdf-4
make config.h
echo patch $SRC/config.h $BASE/config.h.patch
patch $SRC/config.h $BASE/config.h.patch
# Build NetCDF
echo
echo "# Building NetCDF"
make
# Harvest Binaries
echo
echo "# Harvesting Binaries"
rm -rf $BIN
mkdir $BIN
cp $SRC/include/netcdf.h $BIN/netcdf.h
cp $SRC/liblib/.libs/libnetcdf-7.dll $BIN/netcdf.dll
pexports $BIN/netcdf.dll | sed -e 's/libnetcdf-7/netcdf/' >$BIN/netcdf.def
cd $BIN
cmd //c $BASE/lib.bat //machine:i386 //def:netcdf.def //out:netcdf.lib
#dlltool --input-def=$BIN/netcdf.def \
# --dllname=netcdf.dll \
# --output-lib=$BIN/netcdf.lib
Jump to Line
Something went wrong with that request. Please try again.