WSL/SLF GitLab Repository

Commit 11fb1ed6 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Since the autotools are obsolete (and unmaintained) in MeteoIO, they have been...

Since the autotools are obsolete (and unmaintained) in MeteoIO, they have been removed. The popc++ version can be compiled with cmake (with some tricks: disable GSN and force the compiler to popcc). 

For consistency, the various definitions of ot_deg and to_rad have been suppressed and replaced by Cst::to_deg or Cst::to_rad. Some mentions of the Earth's radius have been replaced by Cst::earth_R0. In Coords, some variables have been declared as const.
parent dfb2bf0b
#
# Makefile for the METEOIO Library
#
#Destination system: either zeus, grid or safe
#Prefix: @prefix@
####### USER CONFIGURATION
# build mode: release or debug
MODE = @MODE@
# plugins to build (yes/no)
BORMAIO = @BORMAIO@
IMISIO = @IMISIO@
GEOTOPIO = @GEOTOPIO@
GSNIO = @GSNIO@
SNIO = @SNIO@
SMETIO = @SMETIO@
ARCIO = @ARCIO@
GRASSIO = @GRASSIO@
PROJ4 = @PROJ4@
####### COMPILERS AND OPTIONS
#SVNREV_GEN = $(shell main/version.sh)
#SVNREV = $(eval SVNREV := $(SVNREV_GEN))$(SVNREV)
SVNREV = 0.0
CC = @CC@ -DGNU -DLINUX -D_USE_MATH_DEFINES
CXX = @CXX@ -DGNU -DLINUX -D_USE_MATH_DEFINES
LINKER = @CXX@ -DGNU
POPCC = popcc
DEBUG = -g -O0 #-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC #-dr
#debug_arithm = -DDEBUG_ARITHM -g
WARNING = @WARNING@ @EXTRA_WARN@ #-Weffc++ #-pedantic-errors #-Werror
ARCH = @ARCH@
OPTIM = @OPTIM@
MAKE_OPTIM = @MAKE_OPTIM@
ifeq ($(MODE),debug) #for debug
CFLAGS = $(debug_arithm) $(MAKE_OPTIM) $(ARCH) $(DEBUG) $(WARNING)
CCFLAGS = $(debug_arithm) $(MAKE_OPTIM) $(ARCH) $(DEBUG) $(WARNING)
FFLAGS = $(debug_arithm) $(MAKE_OPTIM) $(DEBUG) $(WARNING)
else #for release
CFLAGS = $(debug_arithm) $(MAKE_OPTIM) $(ARCH) $(OPTIM) $(WARNING)
CCFLAGS = $(debug_arithm) $(MAKE_OPTIM) $(ARCH) $(OPTIM) $(WARNING)
FFLAGS = $(debug_arithm) $(MAKE_OPTIM) $(FFOPTIM) $(WARNING)
endif
#CCFLAGS += -DSVNREV="\"$(SVNREV)\""
CCFLAGS += -D_VERSION="\"$(SVNREV)\""
#################################################
# END USER OPTIONS
#################################################
####### DIRECTORIES
TARGET = meteoio
#TARGET_POPC = meteoio_par
SRCDIR = ./meteoio
PLUGINDIR = ./meteoio/plugins
LIBDIR = ./lib
TOOLSDIR = ./tools
export prefix = @prefix@
export exec_prefix = @exec_prefix@
LIBS = -lc -ldl -lm -lstdc++
LDFLAGS_SEQ = -L$(LIBDIR) -lmeteoio
LD_POPC = -L$(LIBDIR) -lmeteoiopopc
LDFLAGS_POPC = $(LD_POPC)
LDFLAGS = $(LIBS) -rdynamic
INCLUDE = -I.
ifeq ($(PROJ4),yes)
#warning: this is a bug on architectures other than ix386: one can not mix PIC and PDC code
PROJ4_STATIC = @PROJ4_LIBS@
CCFLAGS += -DPROJ4
endif
######## Sources, objects, headers
METEOIO_OBJ = $(SRCDIR)/IOManager.o \
$(SRCDIR)/Matrix.o \
$(SRCDIR)/IOPlugin.o \
$(SRCDIR)/MeteoProcessor.o \
$(SRCDIR)/ResamplingAlgorithms.o \
$(SRCDIR)/ResamplingAlgorithms2D.o \
$(SRCDIR)/Meteo1DInterpolator.o \
$(SRCDIR)/InterpolationAlgorithms.o \
$(SRCDIR)/A3DIO.o \
$(SRCDIR)/Date.o \
$(SRCDIR)/Timer.o \
$(SRCDIR)/Grid2DObject.o \
$(SRCDIR)/IOHandler.o \
$(SRCDIR)/Coords.o \
$(SRCDIR)/Meteo2DInterpolator.o \
$(SRCDIR)/BufferedIOHandler.o \
$(SRCDIR)/DEMObject.o \
$(SRCDIR)/Grid3DObject.o \
$(SRCDIR)/IOInterface.o \
$(SRCDIR)/StationData.o \
$(SRCDIR)/Config.o \
$(SRCDIR)/DynamicLibrary.o \
$(SRCDIR)/IOExceptions.o \
$(SRCDIR)/IOUtils.o \
$(SRCDIR)/MeteoData.o \
$(SRCDIR)/meteofilters/FilterMin.o \
$(SRCDIR)/meteofilters/FilterMax.o \
$(SRCDIR)/meteofilters/FilterMinMax.o \
$(SRCDIR)/meteofilters/FilterMedianAvg.o \
$(SRCDIR)/meteofilters/FilterMeanAvg.o \
$(SRCDIR)/meteofilters/FilterWindAvg.o \
$(SRCDIR)/meteofilters/FilterStdDev.o \
$(SRCDIR)/meteofilters/FilterTukey.o \
$(SRCDIR)/meteofilters/FilterRate.o \
$(SRCDIR)/meteofilters/FilterHNWMelt.o \
$(SRCDIR)/meteofilters/FilterBlock.o \
$(SRCDIR)/meteofilters/WindowedFilter.o \
$(SRCDIR)/meteofilters/ProcessingBlock.o \
$(SRCDIR)/meteofilters/ProcessingStack.o \
$(SRCDIR)/meteolaws/Atmosphere.o \
$(SRCDIR)/meteolaws/Suntrajectory.o \
$(SRCDIR)/meteolaws/Sun.o \
$(SRCDIR)/meteostats/libfit1D.o \
$(SRCDIR)/meteostats/libfit1DCore.o \
$(SRCDIR)/meteostats/libinterpol1D.o \
$(SRCDIR)/meteostats/libinterpol2D.o \
$(SRCDIR)/libsmet.o
METEOIO_OBJ_POPC = $(SRCDIR)/marshal_meteoio_par.o \
$(SRCDIR)/IOManager_par.o \
$(SRCDIR)/Matrix_par.o \
$(SRCDIR)/IOPlugin_par.o \
$(SRCDIR)/MeteoProcessor_par.o \
$(SRCDIR)/ResamplingAlgorithms_par.o \
$(SRCDIR)/ResamplingAlgorithms2D_par.o \
$(SRCDIR)/Meteo1DInterpolator_par.o \
$(SRCDIR)/InterpolationAlgorithms_par.o \
$(SRCDIR)/A3DIO_par.o \
$(SRCDIR)/Date_par.o \
$(SRCDIR)/Timer_par.o \
$(SRCDIR)/Grid2DObject_par.o \
$(SRCDIR)/IOHandler_par.o \
$(SRCDIR)/Coords_par.o \
$(SRCDIR)/Meteo2DInterpolator_par.o \
$(SRCDIR)/BufferedIOHandler_par.o \
$(SRCDIR)/DEMObject_par.o \
$(SRCDIR)/Grid3DObject_par.o \
$(SRCDIR)/IOInterface_par.o \
$(SRCDIR)/StationData_par.o \
$(SRCDIR)/Config_par.o \
$(SRCDIR)/DynamicLibrary_par.o \
$(SRCDIR)/IOExceptions_par.o \
$(SRCDIR)/IOUtils_par.o \
$(SRCDIR)/MeteoData_par.o \
$(SRCDIR)/meteofilters/FilterMin_par.o \
$(SRCDIR)/meteofilters/FilterMax_par.o \
$(SRCDIR)/meteofilters/FilterMinMax_par.o \
$(SRCDIR)/meteofilters/FilterMedianAvg_par.o \
$(SRCDIR)/meteofilters/FilterMeanAvg_par.o \
$(SRCDIR)/meteofilters/FilterWindAvg_par.o \
$(SRCDIR)/meteofilters/FilterStdDev_par.o \
$(SRCDIR)/meteofilters/FilterTukey_par.o \
$(SRCDIR)/meteofilters/FilterRate_par.o \
$(SRCDIR)/meteofilters/FilterHNWMelt_par.o \
$(SRCDIR)/meteofilters/FilterBlock_par.o \
$(SRCDIR)/meteofilters/WindowedFilter_par.o \
$(SRCDIR)/meteofilters/ProcessingBlock_par.o \
$(SRCDIR)/meteofilters/ProcessingStack_par.o \
$(SRCDIR)/meteolaws/Atmosphere_par.o \
$(SRCDIR)/meteolaws/Suntrajectory_par.o \
$(SRCDIR)/meteolaws/Sun_par.o \
$(SRCDIR)/meteostats/libfit1D_par.o \
$(SRCDIR)/meteostats/libfit1DCore_par.o \
$(SRCDIR)/meteostats/libinterpol1D_par.o \
$(SRCDIR)/meteostats/libinterpol2D_par.o \
$(SRCDIR)/libsmet_par.o
TOOLS_OBJ = $(TOOLSDIR)/createA3DFiles.o
####### Build rules SEQ
all: seq
@echo -e "*** MeteoIO compiled as \033[36m$(MODE)\033[0m"
help:
@echo -e "MeteoIO Makefile targets:"
@echo -e " \033[36mseq\033[0m"
@echo -e " \033[36mcreateA3DFiles\033[0m"
@echo -e " \033[36mpar\033[0m"
@echo -e " \033[36minstall\033[0m"
@echo -e " \033[36mclean\033[0m"
@echo -e " \033[36mdistclean\033[0m"
@echo -e " \033[36mdocumentation\033[0m"
seq: $(LIBDIR)/libmeteoio.a build_dynamiclibs
build_dynamiclibs: $(LIBDIR)/plugins/libbormaio.so \
$(LIBDIR)/plugins/libimisio.so \
$(LIBDIR)/plugins/libgeotopio.so \
$(LIBDIR)/plugins/libgsnio.so \
$(LIBDIR)/plugins/libsnio.so \
$(LIBDIR)/plugins/libsmetio.so \
$(LIBDIR)/plugins/libarcio.so \
$(LIBDIR)/plugins/libgrassio.so
############## POPC ##############
par: $(LIBDIR)/libmeteoiopopc.a build_dynamiclibs_par meteoIO_module_par
@echo -e "*** MeteoIO-Popc+ compiled as \033[36m$(MODE)\033[0m"
build_dynamiclibs_par: $(LIBDIR)/plugins/libarciopopc.so \
$(LIBDIR)/plugins/libsmetiopopc.so \
$(LIBDIR)/plugins/libsniopopc.so \
$(LIBDIR)/plugins/libimisiopopc.so \
$(LIBDIR)/plugins/libgrassiopopc.so
meteoIO_module_par: #$(LIBDIR)/meteoio.module
############## END ##############
clean:
-rm -f $(SRCDIR)/*~ $(SRCDIR)/*.o $(TOOLSDIR)/*.o
-rm -f $(PLUGINDIR)/*~ $(PLUGINDIR)/*.o
-rm -f $(SRCDIR)/meteolaws/*~ $(SRCDIR)/meteolaws/*.o
-rm -f $(SRCDIR)/meteofilters/*~ $(SRCDIR)/meteofilters/*.o
-rm -f $(SRCDIR)/meteostats/*~ $(SRCDIR)/meteostats/*.o
# cd $(PLUGINDIR)/gsn; make clean
distclean: clean
-rm -f $(TOOLSDIR)/createA3DFiles
-rm -f $(LIBDIR)/*.a $(LIBDIR)/*.so $(LIBDIR)/*.module
.PHONY: install
install:
@echo **** Installing MeteoIO
mkdir -p @includedir@/meteoio
mkdir -p @includedir@/meteoio/meteofilters
mkdir -p @includedir@/meteoio/meteolaws
mkdir -p @includedir@/meteoio/meteostats
mkdir -p @libdir@
mkdir -p @libdir@/meteoio/plugins
cp ${SRCDIR}/*.h @includedir@/meteoio
cp ${SRCDIR}/*.ph @includedir@/meteoio
cp ${SRCDIR}/meteofilters/*.h @includedir@/meteoio/meteofilters
cp ${SRCDIR}/meteolaws/*.h @includedir@/meteoio/meteolaws
cp ${SRCDIR}/meteostats/*.h @includedir@/meteoio/meteostats
-cp lib/libmeteoio* @libdir@
-cp lib/plugins/*.so @libdir@/meteoio/plugins
#-cp lib/*.module @libdir@/meteoio
documentation:
doxygen $(SRCDIR)/config.dox
####### Compile
.cc.o: $*.cc $*.h
$(CXX) $(CCFLAGS) -fPIC -c $< $(INCLUDE) -o $@
%_par.o : %.cc
$(POPCC) $(CCFLAGS) -fPIC -c $< $(INCLUDE) -o $@
%.stub.o : %.ph
$(POPCC) $(CCFLAGS) -fPIC -c $< $(INCLUDE) -o $@
$(LIBDIR)/libmeteoio.a: $(METEOIO_OBJ)
@echo -e **** Compiling libmeteoIO
ar -r $@ $(METEOIO_OBJ) $(PROJ4_STATIC)
ranlib $@
$(LIBDIR)/libmeteoiopopc.a: $(METEOIO_OBJ_POPC)
@echo -e **** Compiling libmeteoIOpopc
ar -r $@ $(METEOIO_OBJ_POPC) $(PROJ4_STATIC)
ranlib $@
# Dynamic libraries seq
$(LIBDIR)/plugins/libbormaio.so: $(PLUGINDIR)/BormaIO.cc $(PLUGINDIR)/BormaIO.h $(LIBDIR)/libmeteoio.a
ifeq ($(BORMAIO),yes)
@echo **** Compiling Borma plugin
$(CXX) $(CCFLAGS) -fPIC $(INCLUDE) @XMLPP_CFLAGS@ -c -o $(PLUGINDIR)/BormaIO.o $(PLUGINDIR)/BormaIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libbormaio.so -o $@ $(PLUGINDIR)/BormaIO.o $(LDFLAGS) @XMLPP_LIBS@
endif
$(LIBDIR)/plugins/libgeotopio.so:$(PLUGINDIR)/GeotopIO.cc $(PLUGINDIR)/GeotopIO.h $(LIBDIR)/libmeteoio.a
ifeq ($(GEOTOPIO),yes)
@echo **** Compiling GeoTOP plugin
$(CXX) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/GeotopIO.o $(PLUGINDIR)/GeotopIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libgeotopio.so -o $@ $(PLUGINDIR)/GeotopIO.o $(LDFLAGS)
endif
$(LIBDIR)/plugins/libsnio.so:$(PLUGINDIR)/SNIO.cc $(PLUGINDIR)/SNIO.h $(LIBDIR)/libmeteoio.a
ifeq ($(SNIO),yes)
@echo **** Compiling SNOWPACK plugin
$(CXX) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/SNIO.o $(PLUGINDIR)/SNIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libsnio.so -o $@ $(PLUGINDIR)/SNIO.o $(LDFLAGS)
endif
$(LIBDIR)/plugins/libsmetio.so:$(PLUGINDIR)/SMETIO.cc $(PLUGINDIR)/SMETIO.h $(LIBDIR)/libmeteoio.a
ifeq ($(SMETIO),yes)
@echo **** Compiling SMET plugin
$(CXX) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/SMETIO.o $(PLUGINDIR)/SMETIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libsmetio.so -o $@ $(PLUGINDIR)/SMETIO.o $(LDFLAGS)
endif
$(LIBDIR)/plugins/libarcio.so:$(PLUGINDIR)/ARCIO.cc $(PLUGINDIR)/ARCIO.h $(LIBDIR)/libmeteoio.a
ifeq ($(ARCIO),yes)
@echo **** Compiling ARC file plugin
$(CXX) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/ARCIO.o $(PLUGINDIR)/ARCIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libarcio.so -o $@ $(PLUGINDIR)/ARCIO.o $(LDFLAGS)
endif
$(LIBDIR)/plugins/libgrassio.so:$(PLUGINDIR)/GrassIO.cc $(PLUGINDIR)/GrassIO.h $(LIBDIR)/libmeteoio.a
ifeq ($(GRASSIO),yes)
@echo **** Compiling GRASS file plugin
$(CXX) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/GrassIO.o $(PLUGINDIR)/GrassIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libgrassio.so -o $@ $(PLUGINDIR)/GrassIO.o $(LDFLAGS)
endif
$(LIBDIR)/plugins/libgsnio.so:$(PLUGINDIR)/GSNIO.cc $(PLUGINDIR)/GSNIO.h $(LIBDIR)/libmeteoio.a
ifeq ($(GSNIO),yes)
@echo **** Compiling GSN plugin
cd $(PLUGINDIR)/gsn; make
$(CXX) $(CCFLAGS) -fPIC $(INCLUDE) @GSOAPPP_CFLAGS@ -c -o $(PLUGINDIR)/GSNIO.o $(PLUGINDIR)/GSNIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libgsnio.so -o $@ $(PLUGINDIR)/GSNIO.o $(PLUGINDIR)/gsn/soapA3DWebServiceSoap12BindingProxy.o $(PLUGINDIR)/gsn/soapC.o $(LDFLAGS) @GSOAPPP_LIBS@
endif
$(LIBDIR)/plugins/libimisio.so: $(PLUGINDIR)/ImisIO.cc $(PLUGINDIR)/ImisIO.h $(LIBDIR)/libmeteoio.a
ifeq ($(IMISIO),yes)
@echo **** Compiling Imis plugin
$(CXX) $(CCFLAGS) -fPIC $(INCLUDE) -I$(ORACLE_HOME)/client_1/rdbms/public $(PLUGINDIR)/ImisIO.cc -c -o $(PLUGINDIR)/ImisIO.o
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-rpath,$(ORACLE_HOME)/client_1/lib,-soname,libimisio.so -o $@ $(PLUGINDIR)/ImisIO.o $(LDFLAGS) -L$(ORACLE_HOME)/client_1/lib -locci -lclntsh -lstdc++
endif
# Dynamic libraries par
$(LIBDIR)/plugins/libgrassiopopc.so:$(PLUGINDIR)/GrassIO.cc $(PLUGINDIR)/GrassIO.h $(LIBDIR)/libmeteoiopopc.a
ifeq ($(GRASSIO),yes)
@echo **** Compiling GRASS file plugin
$(POPCC) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/GrassIO.o $(PLUGINDIR)/GrassIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libgrassio.so -o $@ $(PLUGINDIR)/GrassIO.o $(LDFLAGS_POPC) $(LDFLAGS)
endif
$(LIBDIR)/plugins/libarciopopc.so:$(PLUGINDIR)/ARCIO.cc $(PLUGINDIR)/ARCIO.h $(LIBDIR)/libmeteoiopopc.a
ifeq ($(ARCIO),yes)
@echo **** Compiling ARC file plugin
$(POPCC) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/ARCIO.o $(PLUGINDIR)/ARCIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libarcio.so -o $@ $(PLUGINDIR)/ARCIO.o $(LDFLAGS_POPC) $(LDFLAGS)
endif
$(LIBDIR)/plugins/libsmetiopopc.so:$(PLUGINDIR)/SMETIO.cc $(PLUGINDIR)/SMETIO.h $(LIBDIR)/libmeteoiopopc.a
ifeq ($(SMETIO),yes)
@echo **** Compiling SMET file plugin
$(POPCC) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/SMETIO.o $(PLUGINDIR)/SMETIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libsmetio.so -o $@ $(PLUGINDIR)/SMETIO.o $(LDFLAGS_POPC) $(LDFLAGS)
endif
$(LIBDIR)/plugins/libsniopopc.so:$(PLUGINDIR)/SNIO.cc $(PLUGINDIR)/SNIO.h $(LIBDIR)/libmeteoiopopc.a
ifeq ($(SNIO),yes)
@echo **** Compiling SNIO file plugin
$(POPCC) $(CCFLAGS) -fPIC $(INCLUDE) -c -o $(PLUGINDIR)/SNIO.o $(PLUGINDIR)/SNIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libsnio.so -o $@ $(PLUGINDIR)/SNIO.o $(LDFLAGS_POPC) $(LDFLAGS)
endif
$(LIBDIR)/plugins/libimisiopopc.so:$(PLUGINDIR)/ImisIO.cc $(PLUGINDIR)/ImisIO.h $(LIBDIR)/libmeteoiopopc.a
ifeq ($(IMISIO),yes)
@echo **** Compiling Imis plugin
$(POPCC) $(CCFLAGS) -fPIC $(INCLUDE) -I$(ORACLE_HOME)/client_1/rdbms/public -c -o $(PLUGINDIR)/ImisIO.o $(PLUGINDIR)/ImisIO.cc
$(CXX) $(CCFLAGS) -rdynamic -shared -Wl,-soname,libimisio.so -o $@ $(PLUGINDIR)/ImisIO.o $(LDFLAGS_POPC) $(LDFLAGS) -L$(ORACLE_HOME)/client_1/lib -locci -lclntsh -lstdc++
endif
######
$(LIBDIR)/meteoio.module: $(LIBDIR)/libmeteoiopopc.a $(SRCDIR)/PackMeteoIO_par.o
$(POPCC) $(CCFLAGS) -object -parocld=$(LINKER) -o $@ $(SRCDIR)/PackMeteoIO_par.o $(LDFLAGS) $(LDFLAGS_POPC)
This diff is collapsed.
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.6])
AC_INIT(meteoio, 1.1.2, bavay@slf.ch)
m4_include(m4/ax_cflags_warn_all.m4)
m4_include(m4/m4_ax_cflags_gcc_option.m4)
m4_include(m4/m4_ax_compiler_vendor.m4)
m4_include(m4/pkg.m4)
#m4_include(m4/m4_ax_check_compiler_flags.m4)
#m4_include(m4/m4_ax_gcc_x86_cpuid.m4)
#m4_include(m4/m4_ax_gcc_archflag.m4)
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_RANLIB
AC_CHECK_PROG([COLORGCC], [colorgcc], [yes], [no])
if test "$COLORGCC" == "yes"
then
AC_MSG_NOTICE([Compiling using colorgcc])
CC=colorgcc
#CXX=colorgcc
fi
#AC_PROG_LIBTOOL
AC_LANG(C++)
#testing GCC flags, assuming that c and c++ compilers are the same
AX_CFLAGS_WARN_ALL(WARNING)
AC_SUBST(WARNING)
AC_ARG_WITH(gcc-arch, [AC_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])], GCC_ARCH=$withval, GCC_ARCH=yes)
if test "x$GCC_ARCH" != xyes
then
ARCH="-march=$GCC_ARCH"
fi
AX_COMPILER_VENDOR
if test "$ax_cv_cxx_compiler_vendor" == "gnu"
then
AC_MSG_NOTICE([Checking specific GNU flags])
AX_CFLAGS_GCC_OPTION(-Wextra, EXTRA_WARN)
AC_SUBST(EXTRA_WARN)
if test "x$GCC_ARCH" = xyes
then
AX_CFLAGS_GCC_OPTION(-march=native, ARCH)
fi
AX_CFLAGS_GCC_OPTION(-g, OPTIM)
AX_CFLAGS_GCC_OPTION(-O3, OPTIM)
AX_CFLAGS_GCC_OPTION(-ftree-vectorize, OPTIM)
AC_SUBST(OPTIM)
AX_CXXFLAGS_GCC_OPTION(-combine, MAKE_OPTIM)
AX_CXXFLAGS_GCC_OPTION(-pipe, MAKE_OPTIM)
AC_SUBST(MAKE_OPTIM)
fi
AC_SUBST(ARCH)
# Checks for libraries.
AC_CHECK_LIB([dl], [main],,[AC_MSG_ERROR([Error, the dl library is missing!])])
AC_CHECK_LIB([c], [main],,[AC_MSG_ERROR([Error, the c library is missing!])])
AC_CHECK_LIB([m], [main],,[AC_MSG_ERROR([Error, the math library is missing!])])
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([dlfcn.h memory.h stdlib.h string.h sys/stat.h math.h],,[AC_MSG_ERROR([The header files must be present!])])
# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
AC_C_CONST
#AC_C_INLINE
#AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_STAT
AC_CHECK_PROG([POPCC], [popcc], [yes], [no])
if test "$POPCC" == "no"
then
AC_MSG_NOTICE([Pop-C++ not found, you won't be able to use the parallel version])
fi
echo
echo "================================="
echo "= USER OPTIONS ="
echo "================================="
######################## DEBUG MODE ######################
AC_ARG_ENABLE(debug, [ --enable-debug Enable debug mode], [debug=yes])
if test "$debug" == "yes"
then
AC_SUBST(MODE,debug)
else
AC_SUBST(MODE,release)
fi
AC_MSG_NOTICE([Compiling for mode '$MODE'])
######################## PLUGINS ##########################
CPPFLAGSOLD="$CPPFLAGS"
LDFLAGSOLD="$LDFLAGS"
echo ""
echo "================================="
echo "= ACTIVATED PLUGINS ="
echo "================================="
AC_ARG_WITH(proj4, [ --with-proj4 enable proj4 geographic coordinates conversions (libproj required)])
AC_SUBST(PROJ4,no)
AC_ARG_WITH(bormaio, [ --with-bormaio enable BormaIO (libxml++-2.6 required)])
AC_SUBST(BORMAIO,no)
AC_ARG_WITH(gsnio, [ --with-gsnio enable GSNIO (gsoap++ required)])
AC_SUBST(GSNIO,no)
AC_ARG_WITH(imisio, [ --with-imisio enable IMISIO ($ORACLE_HOME needs to be set)])
AC_SUBST(IMISIO,no)
AC_ARG_WITH(geotopio, [ --with-geotopio enable GeotopIO ], [use_geotopio=$withval], [use_geotopio=no])
AC_SUBST(GEOTOPIO,$use_geotopio)
AC_ARG_WITH(arcio, [ --without-arcio disable ARCIO plugin (default: enabled)], [use_arcio=$withval], [use_arcio=yes])
AC_SUBST(ARCIO,$use_arcio)
AC_ARG_WITH(snio, [ --without-snio disable SNIO plugin (default: enabled)], [use_snio=$withval], [use_snio=yes])
AC_SUBST(SNIO,$use_snio)
AC_ARG_WITH(smetio, [ --without-smetio disable SMETIO plugin (default: enabled)], [use_smetio=$withval], [use_smetio=yes])
AC_SUBST(SMETIO,$use_snio)
AC_ARG_WITH(grassio, [ --without-grassio disable GrassIO plugin (default: enabled)], [use_grassio=$withval], [use_grassio=yes])
AC_SUBST(GRASSIO,$use_grassio)
AC_ARG_VAR(ORACLE_HOME, [The home of your Oracle client installation])
if test "$with_geotopio" == "yes"; then AC_MSG_NOTICE([GeotopIO enabled. No prerequisites...]); fi
if test "x$use_grassio" == "xyes"; then AC_MSG_NOTICE([GrassIO enabled. No prerequisites...]); fi
if test "x$use_arcio" == "xyes"; then AC_MSG_NOTICE([ARCIO enabled. No prerequisites...]); fi
if test "x$use_snio" == "xyes"; then AC_MSG_NOTICE([SNIO enabled. No prerequisites...]); fi
if test "x$use_smetio" == "xyes"; then AC_MSG_NOTICE([SMETIO enabled. No prerequisites...]); fi
if test "$with_proj4" == "yes"
then
AC_MSG_NOTICE([PROJ4 enabled. Checking for prerequisites...])
AC_CHECK_HEADER([proj_api.h],,[AC_MSG_ERROR([Error, the proj_api.h header file is missing!])])
AC_CHECK_LIB(proj,main,,[AC_MSG_ERROR([Error, the proj4 library is missing!])])
AC_SUBST(PROJ4_CFLAGS)
AC_SUBST(PROJ4_LIBS)
AC_SUBST(PROJ4,yes)
fi
if test "$with_gsnio" == "yes"
then
AC_MSG_NOTICE([GSNIO enabled. Checking for prerequisites...])
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "$PKG_CONFIG" == "no"; then
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
rm -f configure config.status
exit 1
fi
PKG_CHECK_MODULES(GSOAPPP, gsoap++ >= 2.0)
CPPFLAGS="$CPPFLAGS $GSOAPPP_CFLAGS"
AC_SUBST(GSOAPPP_CFLAGS)
AC_SUBST(GSOAPPP_LIBS)
AC_SUBST(GSNIO,yes)
fi
if test "$with_bormaio" == "yes"
then
AC_MSG_NOTICE([BormaIO enabled. Checking for prerequisites...])
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "$PKG_CONFIG" == "no"; then
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
rm -f configure config.status
exit 1
fi
PKG_CHECK_MODULES(XMLPP, libxml++-2.6 >= 2.8)
CPPFLAGS="$CPPFLAGS $XMLPP_CFLAGS"
AC_CHECK_HEADER([libxml++/libxml++.h],,[AC_MSG_ERROR([Error, the libxml++.h header file is missing!])])
#AC_CHECK_LIB(xml2, xmlParseFile,,[AC_MSG_ERROR([Error, the xml++ library is missing!])])
AC_SUBST(XMLPP_CFLAGS)
AC_SUBST(XMLPP_LIBS)
AC_SUBST(BORMAIO,yes)
fi
if test "$with_imisio" == "yes"
then
#use AX_LIB_ORACLE_OCI?
echo ""
AC_MSG_NOTICE([IMISIO enabled. Checking for prerequisites...])
CPPFLAGS="$CPPFLAGS -I$ORACLE_HOME/client_1/include"
LDFLAGS="$LDFLAGS -L$ORACLE_HOME/client_1/lib -lclntsh -lnnz11"
AC_CHECK_HEADER([occi.h],,[AC_MSG_ERROR([Error, the occi.h header file is missing!])])
AC_CHECK_LIB([occi], [main],,[AC_MSG_ERROR([Error, the occi library is missing!])])
AC_SUBST(IMISIO,yes)
fi
AC_SUBST(CPPFLAGS, $CPPFLAGSOLD)
AC_SUBST(LDFLAGS,$LDFLAGSOLD)
AC_SUBST(prefix)
AC_SUBST(execprefix)
echo
AC_OUTPUT(Makefile)
echo "Run 'make' to compile the meteoio library"
\ No newline at end of file
# ===========================================================================
# http://www.nongnu.org/autoconf-archive/ax_cflags_warn_all.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
#
# DESCRIPTION
#
# Try to find a compiler option that enables most reasonable warnings.
#
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
# result is added to the shellvar being CFLAGS by default.
#
# Currently this macro knows about GCC, Solaris C compiler, Digital Unix C
# compiler, C for AIX Compiler, HP-UX C compiler, IRIX C compiler, NEC
# SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos 10.0.0.8) C
# compiler.
#
# - $1 shell-variable-to-add-to : CFLAGS
# - $2 add-value-if-not-found : nothing
# - $3 action-if-found : add value to shellvariable
# - $4 action-if-not-found : nothing
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl