-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
72 lines (57 loc) · 3.3 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
AC_INIT( umkehr,0.6.0)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_F77( gfortran g77 f77 g95 f90 fort77 fl32)
AC_ARG_ENABLE(manylinux,AS_HELP_STRING([--enable-manylinux],[enable manylinux, default: no]), [case "${enableval}" in yes) manylinux=true ;; no) manylinux=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-manylinux]) ;; esac], [manylinux=false])
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable debugging, default: no]), [case "${enableval}" in yes) debug=true ;; no) debug=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; esac], [debug=false])
AC_ARG_VAR(PYVERSION, [manylinux option only. The version of python eg 3.6] )
AC_ARG_VAR(PYBASEDIR, [manylinux option only. The location of python installation in manyliux docker, eg /opt/python/cp36-cp36m])
if [test x"$manylinux" == x"true"]; then
AC_MSG_NOTICE( [For this to work in the manylinux docker, you must use something like ./configure --enable-manylinux PYVERSION="3.6" PYBASEDIR="/opt/python/cp36-cp36m" or similar])
AC_MSG_NOTICE( [Configuring the manylinux versions. This will not check any installed python environment] )
AC_MSG_NOTICE( [manylinux target python = "$PYVERSION"])
AC_MSG_NOTICE( [manylinux python folder = "$PYBASEDIR"])
PYTHON_LIB_DIR="./"
PYTHON_LINK_LIB=""
PYTHON_INCLUDE_DIR="$PYBASEDIR"/python"$PYVERSION"/include
PYTHON_DLLEXT="so"
PYTHON_LINKLIBOPTION=""
AC_SUBST(PYTHON_INCLUDE_DIR)
AC_SUBST(PYTHON_LIB_DIR)
AC_SUBST(PYTHON_LINK_LIB)
AC_SUBST(PYTHON_DLLEXT)
AC_SUBST(PYVERSION)
else
PYTHON_LINKLIBOPTION="-l"
m4_include([m4/ax_python.m4])
AX_PYTHON
fi
#------------------------------------------------------------------------------------
# Setup the directories we need to build the Repos_skclimatology stuff.
# We ned to know the current directory, this is the source code base.
#-------------------------------------------------------------------------------------
UMKEHR_VERSION=$PACKAGE_VERSION
sourcebase=`pwd`
#-----------------------------------------------------------------------------
# Set the compiler flags
#-----------------------------------------------------------------------------
if [test x"$debug" == x"true"]; then
AC_MSG_NOTICE( [Building the DEBUG versions of the library to ${prefix}] )
CPP_FLAGS="-std=c++11 -fvisibility=hidden -g -fPIC -I./"
FOR_FLAGS="-g -fmessage-length=0 -fvisibility=hidden -shared -std=legacy -fpic -ffixed-line-length-72 -Wunused-variable -fdefault-real-8 -fdefault-double-8 -fno-automatic"
else
AC_MSG_NOTICE( [Building the Release versions of the library to ${prefix}] )
CPP_FLAGS="-O3 -std=c++11 -fvisibility=hidden -fPIC -I./"
FOR_FLAGS="-fmessage-length=0 -fvisibility=hidden -shared -std=legacy -fpic -ffixed-line-length-72 -Wunused-variable -fdefault-real-8 -fdefault-double-8 -fno-automatic"
fi
#-----------------------------------------------------------------------------
# Set the variables to export to the makefiles
#-----------------------------------------------------------------------------
AC_SUBST(CPP_FLAGS)
AC_SUBST(FOR_FLAGS)
AC_SUBST(UMKEHR_VERSION)
AC_SUBST(PYTHON_LINKLIBOPTION)
#------------------------------------------------------------------------------
# Export to the makefiles
#------------------------------------------------------------------------------
AC_OUTPUT( Makefile setup.py docs/conf.py )