-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
101 lines (83 loc) · 2.44 KB
/
configure.ac
File metadata and controls
101 lines (83 loc) · 2.44 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(MSCAL, 1.1.0, software@scec.org)
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([foreign tar-pax no-exeext])
dnl
dnl Dependencies
dnl
dnl
dnl Command line tools
dnl
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_LN_S
dnl --- begin: add libtool and --enable-shared handling ---
# initialize libtool (provides LT_INIT and shared/static helpers)
# If libtool is not available, autoreconf will tell you.
LT_INIT
# standard --enable-shared/--disable-shared option
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared|--disable-shared],
[build shared libraries (default: enabled)])],
[case "${enableval}" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*) enable_shared=${enableval} ;;
esac],
[enable_shared=yes])
# export the variable for Makefile.in / Automake
AC_SUBST([enable_shared])
dnl --- end ---
dnl TAR
AC_PATH_PROG(TAR, tar)
if test -z "$TAR" ; then
AC_MSG_FAILURE([cannot find 'tar' program.])
TAR=`echo "Error: tar is not installed." ; false`
fi
dnl
dnl Setup environment so dependencies are used in build
dnl
CFLAGS="$CFLAGS"
CPPFLAGS="-I$prefix/include $CPPFLAGS"
LDFLAGS="-L$prefix/lib -L$prefix/lib64 $LDFLAGS"
dnl
dnl Verify configuration
dnl
##check optional large data path
##MSCAL_LARGEDATA_DIR=$CVM_LARGEDATA_DIR/model/mscal
if test x"$CVM_LARGEDATA_DIR" != x; then
# test directory existence
MSCAL_LARGEDATA_DIR=$CVM_LARGEDATA_DIR/model/mscal
# In docker container building.. this is not accessible yet ???
if test x"$CVM_IN_DOCKER" != x; then
AM_CONDITIONAL([WITH_MSCAL_LARGEDATA_DIR], true)
AC_SUBST(MSCAL_LARGEDATA_DIR)
else
AC_CHECK_FILE([$MSCAL_LARGEDATA_DIR/model_MSCAL_CANVAS_dll0.01_dz50_cmpd.nc],
[AM_CONDITIONAL([WITH_MSCAL_LARGEDATA_DIR], true) AC_SUBST(MSCAL_LARGEDATA_DIR)],
[AM_CONDITIONAL([WITH_MSCAL_LARGEDATA_DIR], false)])
fi
else
AM_CONDITIONAL(WITH_MSCAL_LARGEDATA_DIR, false)
fi
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_CONFIG_FILES([
Makefile
src/Makefile
data/Makefile
test/Makefile
])
AC_OUTPUT
AM_CONDITIONAL([BUILD_SHARED_LIBRARY], [test "$enable_shared" = yes])
if test "$enable_shared" = yes; then
AC_MSG_NOTICE([Building shared libraries. Shared libraries enabled.])
else
AC_MSG_WARN([Building static libraries. Shared libraries are not enabled.])
fi
dnl End of file