source: libcfa/configure.ac @ 4385e8b

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 4385e8b was 08a994e, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Added automatic detection of support for preadv2 and pwritev2

  • Property mode set to 100644
File size: 3.2 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.68])
5AC_INIT([cfa-cc],[1.0.0.0],[cforall@plg.uwaterloo.ca])
6AC_CONFIG_AUX_DIR([automake])
7AC_CONFIG_MACRO_DIRS([automake])
8AM_SILENT_RULES([yes])
9
10m4_include([../automake/cfa.m4])
11
12AM_INIT_AUTOMAKE([subdir-objects])
13
14# don't use the default CFLAGS as they unconditonnaly add -O2
15: ${CFLAGS=""}
16
17# define this to override
18AR_FLAGS="cr"
19
20# Allow program name tansformation
21# will fill program_transform_name with appropriate sed regex
22AC_ARG_PROGRAM
23
24AC_ARG_VAR(ARCHITECTURE,  [The architecture  to use when building libcfa])
25AC_ARG_VAR(CONFIGURATION, [The configuration to use when building libcfa, options are: deubg, nodebug, nolib (prelude-only)])
26AC_ARG_VAR(DRIVER_DIR, [The path to the cforall driver directory])
27AC_ARG_VAR(CFA_VERSION, [The long version of cfa])
28
29AC_ARG_ENABLE(distcc,
30        [  --enable-distcc     whether or not to enable distributed compilation],
31        enable_distcc=$enableval, enable_distcc=no)
32
33echo -n "checking for distributated build... "
34if test x$enable_distcc = xno; then
35        CFACC=${DRIVER_DIR}cfa
36        echo "no"
37else
38        tools="$(readlink -m $ac_confdir/)/../tools/build"
39        config=$(basename $(readlink -f .))
40        echo "$tools/distcc_hash $config"
41        CFADIR_HASH=$($tools/distcc_hash $config)
42        CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa"
43        echo "yes (hash=${CFADIR_HASH})"
44fi
45CFACPP=${DRIVER_DIR}cfa-cpp
46LOCAL_CFACC=${DRIVER_DIR}cfa
47LOCAL_CC1=${DRIVER_DIR}cc1
48
49AM_CONDITIONAL([ENABLE_DISTCC], [test x$enable_distcc = xyes])
50
51AC_SUBST(CFACC)
52AC_SUBST(CFACPP)
53AC_SUBST(LOCAL_CFACC)
54AC_SUBST(LOCAL_CC1)
55AC_SUBST(CFADIR_HASH)
56AC_SUBST(CFA_VERSION)
57
58#==============================================================================
59#Handle specific flags
60case $ARCHITECTURE in
61        "x64"        ) ARCH_FLAGS="-m64";;
62        "x86"        ) ARCH_FLAGS="-m32";;
63        "arm"        ) ARCH_FLAGS="";;
64esac
65
66AC_SUBST(ARCH_FLAGS)
67
68case $CONFIGURATION in
69        "debug"   )
70                CONFIG_CFLAGS="-O0 -g"
71                CONFIG_CFAFLAGS="-debug"
72                CONFIG_BUILDLIB="yes"
73        ;;
74        "nodebug" )
75                CONFIG_CFLAGS="-O3 -s"
76                CONFIG_CFAFLAGS="-nodebug"
77                CONFIG_BUILDLIB="yes"
78        ;;
79        "nolib"   )
80                CONFIG_CFLAGS="-O3 -s"
81                CONFIG_CFAFLAGS="-nolib"
82                CONFIG_BUILDLIB="no"
83        ;;
84        "profile" )
85                CONFIG_CFLAGS="-O3 -g -fno-omit-frame-pointer"
86                CONFIG_CFAFLAGS="-nodebug"
87                CONFIG_BUILDLIB="yes"
88        ;;
89        *)
90        AC_MSG_ERROR('Invalid value $CONFIGURATION for \$CONFIGURATION')
91        ;;
92esac
93
94CONFIG_CFAFLAGS="${CONFIG_CFAFLAGS} ${CFAFLAGS}"
95
96AC_SUBST(CONFIG_CFLAGS)
97AC_SUBST(CONFIG_CFAFLAGS)
98AC_SUBST(CONFIG_BUILDLIB)
99
100AM_CONDITIONAL([BUILDLIB], [test "x${CONFIG_BUILDLIB}" = "xyes"])
101
102#==============================================================================
103#Trasforming cc1 will break compilation
104M4CFA_PROGRAM_NAME
105
106#==============================================================================
107# Installation paths
108M4CFA_PARSE_PREFIX
109
110# Checks for programs.
111LT_INIT
112
113AC_PROG_CXX
114AC_PROG_CC
115AM_PROG_AS
116AC_PROG_LIBTOOL
117AC_PROG_INSTALL
118AC_PROG_MAKE_SET
119
120AC_CHECK_HEADERS([linux/io_uring.h])
121AC_CHECK_FUNCS([preadv2 pwritev2])
122
123AC_CONFIG_FILES([
124        Makefile
125        src/Makefile
126        prelude/Makefile
127        ])
128
129AC_CONFIG_HEADERS(prelude/defines.hfa)
130
131AC_OUTPUT()
132
133# Final text
134AC_MSG_RESULT(Cforall library configuraton completed. Type "make -j 8 install".)
Note: See TracBrowser for help on using the repository browser.