-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
138 lines (120 loc) · 3.76 KB
/
configure.ac
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT(hZCCL, 1.0, jhuan380@ucr.edu)
AM_INIT_AUTOMAKE([foreign -Wall -Werror subdir-objects])
AC_CONFIG_SRCDIR([SZp/src/hZCCL.c])
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
# : ${CFLAGS=-ggdb -O0 -std=c99 -Wall}
: ${CFLAGS=-O3 -std=c99 -Wall}
AC_PROG_CC
AC_PROG_FC
AC_PROG_RANLIB
AM_PROG_AR
AC_PROG_LIBTOOL
#m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_MAINTAINER_MODE([disable])
AC_DEFUN([AC_F90_LIBRARY_LDFLAGS],
[AC_LANG_PUSH(Fortran 90)dnl
_AC_PROG_F90_V
AC_CACHE_CHECK([for Fortran 90 libraries], ac_cv_flibs,
[if test "x$FLIBS" != "x"; then
ac_cv_flibs="$FLIBS" # Let the user override the test.
else
_AC_PROG_F90_V_OUTPUT
ac_cv_flibs=
# Save positional arguments (if any)
ac_save_positional="$[@]"
set X $ac_f90_v_output
while test $[@%:@] != 1; do
shift
ac_arg=$[1]
case $ac_arg in
[[\\/]]*.a | ?:[[\\/]]*.a)
_AC_LIST_MEMBER_IF($ac_arg, $ac_cv_flibs, ,
ac_cv_flibs="$ac_cv_flibs $ac_arg")
;;
-bI:*)
_AC_LIST_MEMBER_IF($ac_arg, $ac_cv_flibs, ,
[_AC_LINKER_OPTION([$ac_arg], ac_cv_flibs)])
;;
# Ignore these flags.
-lang* | -lcrt0.o | -lc | -lgcc | -libmil | -LANG:=*)
;;
-lkernel32)
test x"$CYGWIN" != xyes && ac_cv_flibs="$ac_cv_flibs $ac_arg"
;;
-[[LRuY]])
# These flags, when seen by themselves, take an argument.
# We remove the space between option and argument and re-iterate
# unless we find an empty arg or a new option (starting with -)
case $[2] in
"" | -*);;
*)
ac_arg="$ac_arg$[2]"
shift; shift
set X $ac_arg "$[@]"
;;
esac
;;
-YP,*)
for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
_AC_LIST_MEMBER_IF($ac_j, $ac_cv_flibs, ,
[ac_arg="$ac_arg $ac_j"
ac_cv_flibs="$ac_cv_flibs $ac_j"])
done
;;
-[[lLR]]*)
_AC_LIST_MEMBER_IF($ac_arg, $ac_cv_flibs, ,
ac_cv_flibs="$ac_cv_flibs $ac_arg")
;;
# Ignore everything else.
esac
done
# restore positional arguments
set X $ac_save_positional; shift
# We only consider "LD_RUN_PATH" on Solaris systems. If this is seen,
# then we insist that the "run path" must be an absolute path (i.e. it
# must begin with a "/").
case `(uname -sr) 2>/dev/null` in
"SunOS 5"*)
ac_ld_run_path=`echo $ac_f90_v_output |
sed -n 's,^.*LD_RUN_PATH *= *\(/[[^ ]]*\).*$,-R\1,p'`
test "x$ac_ld_run_path" != x &&
_AC_LINKER_OPTION([$ac_ld_run_path], ac_cv_flibs)
;;
esac
fi # test "x$FLIBS" = "x"
])
FLIBS="$ac_cv_flibs"
AC_SUBST(FLIBS)
AC_LANG_POP(Fortran 90)dnl
])# AC_F90_LIBRARY_LDFLAGS
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stddef.h stdlib.h string.h sys/time.h unistd.h])
#
AC_ARG_ENABLE([fortran],
AS_HELP_STRING([--enable-fortran], [Enable fortran compilation]))
AM_CONDITIONAL([FORTRAN], [test "x$enable_fortran" = "xyes"])
##
## OPENMP
##
AC_ARG_ENABLE(openmp, [ --enable-openmp use OPENMP], ok=$enableval, ok=no)
AM_CONDITIONAL([OPENMP], [test "x$enable_openmp" = "xyes"])
if test "$ok" = "yes"; then
OPENMP_FLAGS="-DHAVE_OPENMP"
fi
AC_SUBST(OPENMP_FLAGS)
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memchr memset strchr strtol])
AC_CONFIG_FILES([Makefile
SZp/Makefile
example/Makefile])
AC_OUTPUT