Changeset c59712e for configure.ac
- Timestamp:
- Aug 3, 2018, 11:25:46 AM (5 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- ff1e0f38
- Parents:
- 25a9b5a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
r25a9b5a rc59712e 15 15 AC_ARG_PROGRAM 16 16 17 #============================================================================== 17 18 #Trasforming cc1 will break compilation 18 19 if test "${program_transform_name}" = ""; then … … 21 22 fi 22 23 24 #Define the new name of the installed command 23 25 AC_ARG_WITH(cfa-name, 24 26 [ --with-cfa-name=NAME NAME too which cfa will be installed], 25 27 cfa_name=$withval, cfa_name="cfa") 26 28 27 #Define the new name of the installed command28 29 AC_SUBST(CFA_NAME, ${cfa_name}) 30 31 #============================================================================== 32 # handle the list of hosts to build for 33 for var in $ac_configure_args 34 do 35 #strip quotes surrouding values 36 var=$(echo $var | sed s/\'//g) 37 case $var in 38 # skip cross compilation related arguments 39 --host=*) ;; host_alias=*) ;; --build=*) ;; build_alias=*) ;; --target=*) ;; target_alias=*) ;; 40 41 # append all other arguments to the sub configure arguments 42 *) LIBCFA_GENERAL_ARGS="${LIBCFA_GENERAL_ARGS} $var";; 43 esac 44 done 45 46 echo $LIBCFA_GENERAL_ARGS 47 48 #============================================================================== 49 # handle the list of hosts to build for 50 AC_CANONICAL_BUILD 51 AC_CANONICAL_HOST 52 53 default_target="${host_cpu}:debug, ${host_cpu}:nodebug" 54 AC_ARG_WITH(target-hosts, 55 [ --with-target-hosts=HOSTS HOSTS comma seperated list of hosts to build for, format ARCH:[debug|nodebug|nolib]], 56 target_hosts=$withval, target_hosts=${default_target}) 57 58 AC_SUBST(TARGET_HOSTS, ${target_hosts}) 59 60 for i in $(echo $target_hosts | sed "s/,/ /g") 61 do 62 # call your procedure/other scripts here below 63 lib_arch=$(echo $i | sed -r "s/:(.*)//g") 64 lib_config=$(echo $i | sed -r "s/(.*)://g") 65 lib_dir="libcfa-${lib_arch}-${lib_config}" 66 67 LIBCFA_TARGET_DIRS="${LIBCFA_TARGET_DIRS} ${lib_dir}" 68 LIBCFA_TARGET_MAKEFILES="${LIBCFA_TARGET_MAKEFILES} ${lib_dir}/Makefile" 69 70 mkdir -p libcfa-${lib_arch}-${lib_config} 71 echo -n "${LIBCFA_GENERAL_ARGS} " > libcfa-${lib_arch}-${lib_config}/config.data 72 echo -n "--host=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data 73 echo -n "CONFIGURATION=${lib_config}" >> libcfa-${lib_arch}-${lib_config}/config.data 74 done 75 76 AC_SUBST(LIBCFA_TARGET_DIRS) 77 AC_SUBST(LIBCFA_TARGET_MAKEFILES) 78 79 80 #============================================================================== 81 # version information 29 82 30 83 rm -f version … … 46 99 AC_DEFINE_UNQUOTED(CFA_VERSION_FULL, ["${ver_major}.${ver_minor}.${ver_patch}.${ver_build}"], [Major.Minor.Patch.Build]) 47 100 48 # Installation paths 49 50 AC_ARG_WITH(backend-compiler, 51 [ --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) ], 52 backendcompiler=$withval, backendcompiler="") 53 if test "x$backendcompiler" != "x"; then 54 BACKEND_CC=${backendcompiler} 55 else 56 AC_PATH_PROG(BACKEND_CC, gcc, []) # check gcc installed 57 if test "x$BACKEND_CC" = "x"; then 58 AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org) 59 exit 1 60 fi 61 fi 62 AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.]) 63 AC_SUBST(CFA_BACKEND_CC) 64 65 66 67 AC_ARG_ENABLE(target-release, AS_HELP_STRING([--enable-target-release], [Build and install the release target])) 68 AC_ARG_ENABLE(target-debug, AS_HELP_STRING([--enable-target-debug], [Build and install the debug target])) 69 AC_ARG_ENABLE(threading, AS_HELP_STRING([--enable-threading], [Build and install libcfa with threading support (Enabled by default)]), 70 [case "${enableval}" in 71 yes) build_threading="yes" ;; 72 no) build_threading="no" ;; 73 *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;; 74 esac],[build_threading="yes"]) 75 76 case "$enable_target_release" in 77 yes) 78 case "$enable_target_debug" in 79 yes) 80 build_release="yes" 81 build_debug="yes" 82 ;; 83 no) 84 build_release="yes" 85 build_debug="no" 86 ;; 87 *) 88 build_release="yes" 89 build_debug="no" 90 ;; 91 esac 92 ;; 93 no) 94 case "$enable_target_debug" in 95 yes) 96 build_release="no" 97 build_debug="yes" 98 ;; 99 no) 100 build_release="no" 101 build_debug="no" 102 ;; 103 *) 104 build_release="no" 105 build_debug="yes" 106 ;; 107 esac 108 ;; 109 *) 110 case "$enable_target_debug" in 111 yes) 112 build_release="no" 113 build_debug="yes" 114 ;; 115 no) 116 build_release="yes" 117 build_debug="no" 118 ;; 119 *) 120 build_release="yes" 121 build_debug="yes" 122 ;; 123 esac 124 ;; 125 esac 126 127 AM_CONDITIONAL([BUILD_RELEASE], [test "x$build_release" = "xyes"]) 128 AM_CONDITIONAL([BUILD_DEBUG], [test "x$build_debug" = "xyes"]) 129 AM_CONDITIONAL([BUILD_NO_LIB], [test "x$build_release$build_debug" = "xnono"]) 130 AM_CONDITIONAL([BUILD_CONCURRENCY], [test "x$build_threading" = "xyes"]) 131 101 #============================================================================== 102 # HACK to be able to use conditionnals inside makefiles 132 103 DOifskipcompile='ifeq ($(skipcompile),yes) 133 104 else' … … 139 110 AM_SUBST_NOTMAKE([DOendif]) 140 111 112 #============================================================================== 113 # backend compiler implementation 114 AC_ARG_WITH(backend-compiler, 115 [ --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) ], 116 backendcompiler=$withval, backendcompiler="") 117 if test "x$backendcompiler" != "x"; then 118 BACKEND_CC=${backendcompiler} 119 else 120 AC_PATH_PROG(BACKEND_CC, gcc, []) # check gcc installed 121 if test "x$BACKEND_CC" = "x"; then 122 AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org) 123 exit 1 124 fi 125 fi 126 AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.]) 127 AC_SUBST(CFA_BACKEND_CC) 128 129 #============================================================================== 130 # Installation paths 141 131 if test "x$prefix" = "xNONE"; then 142 132 cfa_prefix=${ac_default_prefix} … … 171 161 AC_SUBST(CFA_LIBDIR, ${cfa_libdir}) 172 162 163 #============================================================================== 173 164 # Create variables for commonly used targets 174 165 DRIVER_DIR='$(top_builddir)/driver' … … 182 173 AC_DEFINE_UNQUOTED(PRELUDE_BUILDDIR, "$ac_pwd/libcfa/prelude/", [Directory where the prelude files are built]) 183 174 175 #============================================================================== 184 176 # Flag variables needed to build in tree 185 177 LIBCFA_SRC='$(top_srcdir)/libcfa/src' … … 190 182 AC_SUBST(BUILD_IN_TREE_FLAGS) 191 183 192 AC_CANONICAL_BUILD 193 AC_CANONICAL_HOST 194 AC_SUBST([MACHINE_TYPE],[$host_cpu]) 195 196 if ! test "$host_cpu" = "$build_cpu"; then 197 case $host_cpu in 198 i386) 199 CFLAGS+=" -m32 " 200 CXXFLAGS+=" -m32 " 201 CFAFLAGS+=" -m32 " 202 LDFLAGS+=" -m32 " 203 ;; 204 i686) 205 CFLAGS+=" -m32 " 206 CXXFLAGS+=" -m32 " 207 CFAFLAGS+=" -m32 " 208 LDFLAGS+=" -m32 " 209 ;; 210 x86_64) 211 CFLAGS+=" -m64 " 212 CXXFLAGS+=" -m64 " 213 CFAFLAGS+=" -m64 " 214 LDFLAGS+=" -m64 " 215 ;; 216 esac 217 fi 218 184 #============================================================================== 185 # CAFLAGS 219 186 AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.]) 220 187 AC_SUBST(CFA_FLAGS, ${CFAFLAGS}) 221 188 189 #============================================================================== 222 190 # Checks for programs. 223 191 AC_PROG_CXX … … 255 223 AC_CHECK_FUNCS([memset putenv strchr strtol]) 256 224 225 #============================================================================== 257 226 AC_CONFIG_FILES([ 258 227 Makefile … … 262 231 tests/Makefile 263 232 tests/preempt_longrun/Makefile 264 libcfa/prelude/Makefile265 libcfa/src/Makefile266 233 tools/Makefile 267 234 tools/prettyprinter/Makefile … … 272 239 AC_OUTPUT(tests/config.py) 273 240 274 AM_COND_IF([BUILD_RELEASE],275 [AM_COND_IF([BUILD_DEBUG],276 [AC_MSG_NOTICE(Building libcfa for target: release & debug)],277 [AC_MSG_NOTICE(Building libcfa for target: release)])],278 [AM_COND_IF([BUILD_DEBUG],279 [AC_MSG_NOTICE(Building libcfa for target: debug)],280 [AC_MSG_NOTICE(Running cfa without libcfa)])])281 282 241 # Final text 283 242 AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".)
Note: See TracChangeset
for help on using the changeset viewer.