Changeset 37fe352
- Timestamp:
- Aug 5, 2018, 4:11:41 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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:
- 28582b2
- Parents:
- 4dcaed2
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
automake/cfa.m4
r4dcaed2 r37fe352 26 26 27 27 if test "$libdir" = '${exec_prefix}/lib'; then 28 cfa_libdir="${cfa_prefix}/lib/${cfa_name} "28 cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}${CONFIGURATION}" 29 29 else 30 cfa_libdir= ${libdir}30 cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}" 31 31 fi 32 32 AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.]) 33 33 AC_SUBST(CFA_LIBDIR, ${cfa_libdir}) 34 34 ]) 35 36 m4_define([M4CFA_PROGRAM_NAME], [ 37 if test "${program_transform_name}" = ""; then 38 AC_MSG_ERROR([Program transform not supported. 39 Use --with-cfa-name='[[Desired name here]]' instead]) 40 fi 41 42 #Define the new name of the installed command 43 AC_ARG_WITH(cfa-name, 44 [ --with-cfa-name=NAME NAME too which cfa will be installed], 45 cfa_name=$withval, cfa_name="cfa") 46 47 AC_SUBST(CFA_NAME, ${cfa_name}) 48 ]) 49 50 AC_DEFUN([M4CFA_CANNON_CPU], [ 51 case $arch_name in 52 "x64" ) cannon_arch_name="x64";; 53 "x86-64" ) cannon_arch_name="x64";; 54 "x86_64" ) cannon_arch_name="x64";; 55 "x86" ) cannon_arch_name="x86";; 56 "i386" ) cannon_arch_name="x86";; 57 "i486" ) cannon_arch_name="x86";; 58 "i686" ) cannon_arch_name="x86";; 59 "Intel 80386") cannon_arch_name="x86";; 60 "arm" ) cannon_arch_name="arm";; 61 "ARM" ) cannon_arch_name="arm";; 62 *) 63 >&2 echo "Unkown architecture " $arch_name; 64 exit 1 65 ;; 66 esac 67 ]) -
configure
r4dcaed2 r37fe352 2523 2523 2524 2524 2525 2526 2527 2528 2525 2529 am__api_version='1.15' 2526 2530 … … 3070 3074 #============================================================================== 3071 3075 #Trasforming cc1 will break compilation 3072 if test "${program_transform_name}" = ""; then 3073 as_fn_error $? "Program transform not supported. 3074 Use --with-cfa-name='[Desired name here]' instead" "$LINENO" 5 3075 fi 3076 3077 #Define the new name of the installed command 3076 3077 if test "${program_transform_name}" = ""; then 3078 as_fn_error $? "Program transform not supported. 3079 Use --with-cfa-name='[Desired name here]' instead" "$LINENO" 5 3080 fi 3081 3082 #Define the new name of the installed command 3078 3083 3079 3084 # Check whether --with-cfa-name was given. … … 3085 3090 3086 3091 3087 CFA_NAME=${cfa_name}3092 CFA_NAME=${cfa_name} 3088 3093 3089 3094 … … 3261 3266 3262 3267 if test "$libdir" = '${exec_prefix}/lib'; then 3263 cfa_libdir="${cfa_prefix}/lib/${cfa_name} "3268 cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}${CONFIGURATION}" 3264 3269 else 3265 cfa_libdir= ${libdir}3270 cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}" 3266 3271 fi 3267 3272 … … 3415 3420 arch_name=$(echo $i | sed -r "s/:(.*)//g") 3416 3421 lib_config=$(echo $i | sed -r "s/(.*)://g") 3417 if test $lib_config != "nodebug"; 3418 then 3419 if test $lib_config != "debug"; 3420 then 3421 if test $lib_config != "nolib"; 3422 then 3423 >&2 echo "Configuration must be 'debug', 'nodebug' or 'nolib'" 3424 exit 1 3425 fi 3426 fi 3427 fi 3428 3429 lib_arch=$($ac_aux_dir/config.sub $arch_name) 3430 if test "$?" != "0"; then 3422 3423 case $lib_config in 3424 "nodebug") ;; 3425 "debug") ;; 3426 "nolib") ;; 3427 *) 3428 >&2 echo "Configuration must be 'debug', 'nodebug' or 'nolib'" 3429 exit 1 3430 ;; 3431 esac 3432 3433 3434 case $arch_name in 3435 "x64" ) cannon_arch_name="x64";; 3436 "x86-64" ) cannon_arch_name="x64";; 3437 "x86_64" ) cannon_arch_name="x64";; 3438 "x86" ) cannon_arch_name="x86";; 3439 "i386" ) cannon_arch_name="x86";; 3440 "i486" ) cannon_arch_name="x86";; 3441 "i686" ) cannon_arch_name="x86";; 3442 "Intel 80386") cannon_arch_name="x86";; 3443 "arm" ) cannon_arch_name="arm";; 3444 "ARM" ) cannon_arch_name="arm";; 3445 *) 3431 3446 >&2 echo "Unkown architecture " $arch_name; 3432 exit 1; 3433 fi 3447 exit 1 3448 ;; 3449 esac 3450 3451 lib_arch=${cannon_arch_name} 3434 3452 lib_dir="libcfa-${lib_arch}-${lib_config}" 3435 3453 … … 3440 3458 echo -n "${LIBCFA_GENERAL_ARGS} " > libcfa-${lib_arch}-${lib_config}/config.data 3441 3459 echo -n "${LIBCFA_PATHS} " >> libcfa-${lib_arch}-${lib_config}/config.data 3442 echo -n " --host=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data3460 echo -n "ARCHITECTURE=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data 3443 3461 echo -n "CONFIGURATION=${lib_config}" >> libcfa-${lib_arch}-${lib_config}/config.data 3444 3462 done 3445 3463 3446 3464 3465 3466 3467 3468 case $arch_name in 3469 "x64" ) cannon_arch_name="x64";; 3470 "x86-64" ) cannon_arch_name="x64";; 3471 "x86_64" ) cannon_arch_name="x64";; 3472 "x86" ) cannon_arch_name="x86";; 3473 "i386" ) cannon_arch_name="x86";; 3474 "i486" ) cannon_arch_name="x86";; 3475 "i686" ) cannon_arch_name="x86";; 3476 "Intel 80386") cannon_arch_name="x86";; 3477 "arm" ) cannon_arch_name="arm";; 3478 "ARM" ) cannon_arch_name="arm";; 3479 *) 3480 >&2 echo "Unkown architecture " $arch_name; 3481 exit 1 3482 ;; 3483 esac 3484 3485 3486 cat >>confdefs.h <<_ACEOF 3487 #define CFA_DEFAULT_CPU "$cannon_arch_name" 3488 _ACEOF 3489 3490 3491 cat >>confdefs.h <<_ACEOF 3492 #define CFA_64_CPU "x64" 3493 _ACEOF 3494 3495 3496 cat >>confdefs.h <<_ACEOF 3497 #define CFA_32_CPU "x86" 3498 _ACEOF 3447 3499 3448 3500 -
configure.ac
r4dcaed2 r37fe352 19 19 #============================================================================== 20 20 #Trasforming cc1 will break compilation 21 if test "${program_transform_name}" = ""; then 22 AC_MSG_ERROR([Program transform not supported. 23 Use --with-cfa-name='[[Desired name here]]' instead]) 24 fi 25 26 #Define the new name of the installed command 27 AC_ARG_WITH(cfa-name, 28 [ --with-cfa-name=NAME NAME too which cfa will be installed], 29 cfa_name=$withval, cfa_name="cfa") 30 31 AC_SUBST(CFA_NAME, ${cfa_name}) 32 21 M4CFA_PROGRAM_NAME 33 22 34 23 #============================================================================== … … 143 132 arch_name=$(echo $i | sed -r "s/:(.*)//g") 144 133 lib_config=$(echo $i | sed -r "s/(.*)://g") 145 if test $lib_config != "nodebug"; 146 then 147 if test $lib_config != "debug"; 148 then 149 if test $lib_config != "nolib"; 150 then 151 >&2 echo "Configuration must be 'debug', 'nodebug' or 'nolib'" 152 exit 1 153 fi 154 fi 155 fi 156 157 lib_arch=$($ac_aux_dir/config.sub $arch_name) 158 if test "$?" != "0"; then 159 >&2 echo "Unkown architecture " $arch_name; 160 exit 1; 161 fi 134 135 case $lib_config in 136 "nodebug") ;; 137 "debug") ;; 138 "nolib") ;; 139 *) 140 >&2 echo "Configuration must be 'debug', 'nodebug' or 'nolib'" 141 exit 1 142 ;; 143 esac 144 145 M4CFA_CANNON_CPU([${arch_name}]) 146 lib_arch=${cannon_arch_name} 162 147 lib_dir="libcfa-${lib_arch}-${lib_config}" 163 148 … … 168 153 echo -n "${LIBCFA_GENERAL_ARGS} " > libcfa-${lib_arch}-${lib_config}/config.data 169 154 echo -n "${LIBCFA_PATHS} " >> libcfa-${lib_arch}-${lib_config}/config.data 170 echo -n " --host=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data155 echo -n "ARCHITECTURE=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data 171 156 echo -n "CONFIGURATION=${lib_config}" >> libcfa-${lib_arch}-${lib_config}/config.data 172 157 done … … 174 159 AC_SUBST(LIBCFA_TARGET_DIRS) 175 160 AC_SUBST(LIBCFA_TARGET_MAKEFILES) 161 162 M4CFA_CANNON_CPU([${host_cpu}]) 163 AC_DEFINE_UNQUOTED(CFA_DEFAULT_CPU, "$cannon_arch_name", [Default cpu to use if neither -m32 or -m64 are defined.]) 164 AC_DEFINE_UNQUOTED(CFA_64_CPU, "x64", [CPU to use if the -m64 flags is given.]) 165 AC_DEFINE_UNQUOTED(CFA_32_CPU, "x86", [CPU to use if the -m32 flags is given.]) 176 166 177 167 #============================================================================== -
driver/cfa.cc
r4dcaed2 r37fe352 21 21 #include <string.h> // strcmp 22 22 23 #include <sys/types.h> 24 #include <sys/stat.h> 25 23 26 #include "Common/SemanticError.h" 24 27 #include "config.h" // configure info … … 66 69 } // shuffle 67 70 71 static inline bool dirExists(const string & path) { 72 struct stat info; 73 if(stat( path.c_str(), &info ) != 0) 74 return false; 75 else if(info.st_mode & S_IFDIR) 76 return true; 77 else 78 return false; 79 } //dirExists 80 68 81 69 82 #define str(s) #s … … 96 109 bool xflag = false; // user supplied -x flag 97 110 bool debugging __attribute(( unused )) = false; // -g flag 111 bool m32 = false; // -m32 flag 112 bool m64 = false; // -m64 flag 113 bool intree = false; 98 114 99 115 const char *args[argc + 100]; // cfa command line values, plus some space for additional flags … … 154 170 } else if ( arg == "-no-include-stdhdr" ) { 155 171 noincstd_flag = true; // strip the no-include-stdhdr flag 172 } else if ( arg == "-in-tree" ) { 173 noincstd_flag = true; 174 intree = true; 156 175 } else if ( arg == "-compiler" ) { 157 176 // use the user specified compiler … … 258 277 libs[nlibs] = argv[i]; 259 278 nlibs += 1; 279 } else if ( arg == "-m32" ) { 280 m32 = true; 281 m64 = false; 282 args[nargs] = argv[i]; 283 nargs += 1; 284 } else if ( arg == "-m64" ) { 285 m64 = true; 286 m32 = false; 287 args[nargs] = argv[i]; 288 nargs += 1; 260 289 } else { 261 290 // concatenate any other arguments … … 320 349 nargs += 1; 321 350 351 string libdir; 352 if( !intree ) { 353 const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 354 const char * config = debug ? "debug": "nodebug"; 355 libdir = string(CFA_LIBDIR) + arch + config; 356 if( !dirExists(libdir) ) { 357 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 358 cerr << "Was looking for " << libdir << endl; 359 libdir = string(CFA_LIBDIR) + arch + "nolib"; 360 } 361 362 if( !dirExists(libdir) ) { 363 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 364 cerr << "Was looking for " << libdir << endl; 365 exit( EXIT_FAILURE ); 366 } 367 368 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir) ).c_str(); 369 nargs += 1; 370 } else { 371 args[nargs] = "-D__CFA_FLAG__=-t"; 372 nargs += 1; 373 } 374 322 375 if ( link ) { 323 376 args[nargs] = "-Xlinker"; … … 335 388 336 389 // include the cfa library in case it's needed 337 args[nargs] = "-L" CFA_LIBDIR; 338 nargs += 1; 339 if ( debug ) { 340 args[nargs] = "-lcfa-d"; 341 } else { 342 args[nargs] = "-lcfa"; 343 } // if 390 if( !intree ) { 391 args[nargs] = ( *new string( string("-L" ) + libdir) ).c_str(); 392 nargs += 1; 393 } 394 args[nargs] = "-lcfa"; 344 395 nargs += 1; 345 396 args[nargs] = "-lpthread"; … … 400 451 } // if 401 452 402 403 404 405 453 args[nargs] = "-Xlinker"; // used by backtrace 454 nargs += 1; 455 args[nargs] = "-export-dynamic"; 456 nargs += 1; 406 457 407 458 // execute the compilation command -
libcfa/Makefile.in
r4dcaed2 r37fe352 89 89 PRE_UNINSTALL = : 90 90 POST_UNINSTALL = : 91 build_triplet = @build@92 host_triplet = @host@93 91 subdir = . 94 92 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 95 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 93 am__aclocal_m4_deps = $(top_srcdir)/../automake/cfa.m4 \ 94 $(top_srcdir)/configure.ac 96 95 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 97 96 $(ACLOCAL_M4) … … 161 160 am__DIST_COMMON = $(srcdir)/Makefile.in \ 162 161 $(top_srcdir)/./automake/compile \ 163 $(top_srcdir)/./automake/config.guess \164 $(top_srcdir)/./automake/config.sub \165 162 $(top_srcdir)/./automake/install-sh \ 166 163 $(top_srcdir)/./automake/missing ./automake/compile \ … … 212 209 AMTAR = @AMTAR@ 213 210 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 211 ARCHITECTURE = @ARCHITECTURE@ 212 ARCH_FLAGS = @ARCH_FLAGS@ 214 213 AUTOCONF = @AUTOCONF@ 215 214 AUTOHEADER = @AUTOHEADER@ … … 226 225 CFA_INCDIR = @CFA_INCDIR@ 227 226 CFA_LIBDIR = @CFA_LIBDIR@ 227 CFA_NAME = @CFA_NAME@ 228 228 CFA_PREFIX = @CFA_PREFIX@ 229 229 CFLAGS = @CFLAGS@ … … 278 278 am__untar = @am__untar@ 279 279 bindir = @bindir@ 280 build = @build@281 280 build_alias = @build_alias@ 282 build_cpu = @build_cpu@283 build_os = @build_os@284 build_vendor = @build_vendor@285 281 builddir = @builddir@ 286 282 datadir = @datadir@ … … 289 285 dvidir = @dvidir@ 290 286 exec_prefix = @exec_prefix@ 291 host = @host@292 287 host_alias = @host_alias@ 293 host_cpu = @host_cpu@294 host_os = @host_os@295 host_vendor = @host_vendor@296 288 htmldir = @htmldir@ 297 289 includedir = @includedir@ -
libcfa/configure
r4dcaed2 r37fe352 622 622 CFA_INCDIR 623 623 CFA_PREFIX 624 CFA_NAME 625 ARCH_FLAGS 624 626 CFACPP 625 627 CFACC 626 628 DRIVER_DIR 627 629 CONFIGURATION 628 host_os 629 host_vendor 630 host_cpu 631 host 632 build_os 633 build_vendor 634 build_cpu 635 build 630 ARCHITECTURE 636 631 AM_BACKSLASH 637 632 AM_DEFAULT_VERBOSITY … … 704 699 enable_option_checking 705 700 enable_silent_rules 701 with_cfa_name 706 702 enable_dependency_tracking 707 703 ' … … 709 705 host_alias 710 706 target_alias 707 ARCHITECTURE 711 708 CONFIGURATION 712 709 DRIVER_DIR … … 1333 1330 --program-suffix=SUFFIX append SUFFIX to installed program names 1334 1331 --program-transform-name=PROGRAM run sed PROGRAM on installed program names 1335 1336 System types:1337 --build=BUILD configure for building on BUILD [guessed]1338 --host=HOST cross-compile to build programs to run on HOST [BUILD]1339 1332 _ACEOF 1340 1333 fi … … 1357 1350 speeds up one-time build 1358 1351 1352 Optional Packages: 1353 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] 1354 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) 1355 --with-cfa-name=NAME NAME too which cfa will be installed 1356 1359 1357 Some influential environment variables: 1358 ARCHITECTURE 1359 The architecture to use when building libcfa 1360 1360 CONFIGURATION 1361 1361 The configuration to use when building libcfa, options are: … … 1911 1911 1912 1912 1913 1914 1915 1916 1917 1918 1919 1913 1920 am__api_version='1.15' 1914 1921 … … 2495 2502 2496 2503 2497 # Make sure we can run config.sub.2498 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||2499 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 52500 2501 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&52502 $as_echo_n "checking build system type... " >&6; }2503 if ${ac_cv_build+:} false; then :2504 $as_echo_n "(cached) " >&62505 else2506 ac_build_alias=$build_alias2507 test "x$ac_build_alias" = x &&2508 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`2509 test "x$ac_build_alias" = x &&2510 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 52511 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||2512 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 52513 2514 fi2515 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&52516 $as_echo "$ac_cv_build" >&6; }2517 case $ac_cv_build in2518 *-*-*) ;;2519 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;2520 esac2521 build=$ac_cv_build2522 ac_save_IFS=$IFS; IFS='-'2523 set x $ac_cv_build2524 shift2525 build_cpu=$12526 build_vendor=$22527 shift; shift2528 # Remember, the first character of IFS is used to create $*,2529 # except with old shells:2530 build_os=$*2531 IFS=$ac_save_IFS2532 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac2533 2534 2535 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&52536 $as_echo_n "checking host system type... " >&6; }2537 if ${ac_cv_host+:} false; then :2538 $as_echo_n "(cached) " >&62539 else2540 if test "x$host_alias" = x; then2541 ac_cv_host=$ac_cv_build2542 else2543 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||2544 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 52545 fi2546 2547 fi2548 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&52549 $as_echo "$ac_cv_host" >&6; }2550 case $ac_cv_host in2551 *-*-*) ;;2552 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;2553 esac2554 host=$ac_cv_host2555 ac_save_IFS=$IFS; IFS='-'2556 set x $ac_cv_host2557 shift2558 host_cpu=$12559 host_vendor=$22560 shift; shift2561 # Remember, the first character of IFS is used to create $*,2562 # except with old shells:2563 host_os=$*2564 IFS=$ac_save_IFS2565 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac2566 2567 2568 2504 2569 2505 … … 2575 2511 2576 2512 2513 case $ARCHITECTURE in 2514 "x64" ) ARCH_FLAGS="-m64";; 2515 "x86" ) ARCH_FLAGS="-m32";; 2516 "arm" ) ARCH_FLAGS="";; 2517 esac 2518 2519 2520 2521 #============================================================================== 2522 #Trasforming cc1 will break compilation 2523 2524 if test "${program_transform_name}" = ""; then 2525 as_fn_error $? "Program transform not supported. 2526 Use --with-cfa-name='[Desired name here]' instead" "$LINENO" 5 2527 fi 2528 2529 #Define the new name of the installed command 2530 2531 # Check whether --with-cfa-name was given. 2532 if test "${with_cfa_name+set}" = set; then : 2533 withval=$with_cfa_name; cfa_name=$withval 2534 else 2535 cfa_name="cfa" 2536 fi 2537 2538 2539 CFA_NAME=${cfa_name} 2540 2541 2542 2577 2543 #============================================================================== 2578 2544 # Installation paths 2579 if test "x$prefix" = "xNONE"; then 2580 cfa_prefix=${ac_default_prefix} 2581 else 2582 cfa_prefix=${prefix} 2583 fi 2545 2546 if test "x$prefix" = "xNONE"; then 2547 cfa_prefix=${ac_default_prefix} 2548 else 2549 cfa_prefix=${prefix} 2550 fi 2584 2551 2585 2552 cat >>confdefs.h <<_ACEOF … … 2587 2554 _ACEOF 2588 2555 2589 CFA_PREFIX=${cfa_prefix}2590 2591 2592 if test "$includedir" = '${prefix}/include'; then2593 2594 else2595 2596 fi2556 CFA_PREFIX=${cfa_prefix} 2557 2558 2559 if test "$includedir" = '${prefix}/include'; then 2560 cfa_incdir="${cfa_prefix}/include/${cfa_name}" 2561 else 2562 cfa_incdir=${includedir} 2563 fi 2597 2564 2598 2565 cat >>confdefs.h <<_ACEOF … … 2600 2567 _ACEOF 2601 2568 2602 CFA_INCDIR=${cfa_incdir}2603 2604 2605 if test "$bindir" = '${exec_prefix}/bin'; then2606 2607 else2608 2609 fi2569 CFA_INCDIR=${cfa_incdir} 2570 2571 2572 if test "$bindir" = '${exec_prefix}/bin'; then 2573 cfa_bindir="${cfa_prefix}/bin" 2574 else 2575 cfa_bindir=${bindir} 2576 fi 2610 2577 2611 2578 cat >>confdefs.h <<_ACEOF … … 2613 2580 _ACEOF 2614 2581 2615 CFA_BINDIR=${cfa_bindir}2616 2617 2618 if test "$libdir" = '${exec_prefix}/lib'; then2619 cfa_libdir="${cfa_prefix}/lib/${cfa_name}"2620 else2621 cfa_libdir=${libdir} 2622 fi2582 CFA_BINDIR=${cfa_bindir} 2583 2584 2585 if test "$libdir" = '${exec_prefix}/lib'; then 2586 cfa_libdir="${cfa_prefix}/lib/${cfa_name}/${ARCHITECTURE}${CONFIGURATION}" 2587 else 2588 cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}" 2589 fi 2623 2590 2624 2591 cat >>confdefs.h <<_ACEOF … … 2626 2593 _ACEOF 2627 2594 2628 CFA_LIBDIR=${cfa_libdir} 2595 CFA_LIBDIR=${cfa_libdir} 2596 2629 2597 2630 2598 -
libcfa/configure.ac
r4dcaed2 r37fe352 6 6 AC_CONFIG_AUX_DIR([./automake]) 7 7 8 m4_include([../automake/cfa.m4]) 9 8 10 AM_INIT_AUTOMAKE([subdir-objects]) 9 11 … … 12 14 AC_ARG_PROGRAM 13 15 14 AC_CANONICAL_BUILD 15 AC_CANONICAL_HOST 16 16 AC_ARG_VAR(ARCHITECTURE, [The architecture to use when building libcfa]) 17 17 AC_ARG_VAR(CONFIGURATION, [The configuration to use when building libcfa, options are: deubg, nodebug, nolib (prelude-only)]) 18 18 AC_ARG_VAR(DRIVER_DIR, [The path to the cforall driver directory]) … … 23 23 AC_SUBST(CFACPP) 24 24 25 case $ARCHITECTURE in 26 "x64" ) ARCH_FLAGS="-m64";; 27 "x86" ) ARCH_FLAGS="-m32";; 28 "arm" ) ARCH_FLAGS="";; 29 esac 30 31 AC_SUBST(ARCH_FLAGS) 32 33 #============================================================================== 34 #Trasforming cc1 will break compilation 35 M4CFA_PROGRAM_NAME 36 25 37 #============================================================================== 26 38 # Installation paths 27 if test "x$prefix" = "xNONE"; then 28 cfa_prefix=${ac_default_prefix} 29 else 30 cfa_prefix=${prefix} 31 fi 32 AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.]) 33 AC_SUBST(CFA_PREFIX, ${cfa_prefix}) 34 35 if test "$includedir" = '${prefix}/include'; then 36 cfa_incdir="${cfa_prefix}/include/${cfa_name}" 37 else 38 cfa_incdir=${includedir} 39 fi 40 AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.]) 41 AC_SUBST(CFA_INCDIR, ${cfa_incdir}) 42 43 if test "$bindir" = '${exec_prefix}/bin'; then 44 cfa_bindir="${cfa_prefix}/bin" 45 else 46 cfa_bindir=${bindir} 47 fi 48 AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.]) 49 AC_SUBST(CFA_BINDIR, ${cfa_bindir}) 50 51 if test "$libdir" = '${exec_prefix}/lib'; then 52 cfa_libdir="${cfa_prefix}/lib/${cfa_name}" 53 else 54 cfa_libdir=${libdir} 55 fi 56 AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.]) 57 AC_SUBST(CFA_LIBDIR, ${cfa_libdir}) 39 M4CFA_PARSE_PREFIX 58 40 59 41 # Checks for programs. -
libcfa/prelude/Makefile.am
r4dcaed2 r37fe352 24 24 25 25 CC = @CFACC@ 26 AM_CFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ 26 27 27 28 $(DEPDIR) : … … 33 34 # create extra forward types/declarations to reduce inclusion of library files 34 35 extras.cf : ${srcdir}/extras.regx ${srcdir}/extras.c 35 ${AM_V_GEN}gcc -E ${srcdir}/extras.c | grep -f ${srcdir}/extras.regx > extras.cf36 ${AM_V_GEN}gcc ${AM_CFLAGS} -E ${srcdir}/extras.c | grep -f ${srcdir}/extras.regx > extras.cf 36 37 37 38 # create forward declarations for gcc builtins … … 43 44 44 45 prelude.cf : prelude-gen.cc 45 ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${ <} -o prelude-gen -Wall -Wextra -O2 -g -std=c++1446 ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o prelude-gen -Wall -Wextra -O2 -g -std=c++14 46 47 @./prelude-gen > $@ 47 48 @rm ./prelude-gen … … 53 54 # create forward declarations for cfa builtins 54 55 builtins.cf : builtins.c ${CC} 55 ${AM_V_GEN} ${CC} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po56 ${AM_V_GEN}gcc ${AM_CFLAGS} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po 56 57 ${AM_V_at}sed -i 's/builtins.o/builtins.cf/g' $(DEPDIR)/builtins.Po 57 58 … … 67 68 rm -rf $(DEPDIR) 68 69 69 MAINTAINERCLEANFILES = gcc-builtins.c gcc-builtins.cf builtins.cf extras.cf bootloader.c prelude.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} 70 MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cf 71 MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} -
libcfa/prelude/Makefile.in
r4dcaed2 r37fe352 90 90 PRE_UNINSTALL = : 91 91 POST_UNINSTALL = : 92 build_triplet = @build@93 host_triplet = @host@94 92 subdir = prelude 95 93 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 96 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 94 am__aclocal_m4_deps = $(top_srcdir)/../automake/cfa.m4 \ 95 $(top_srcdir)/configure.ac 97 96 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 98 97 $(ACLOCAL_M4) … … 155 154 AMTAR = @AMTAR@ 156 155 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 156 ARCHITECTURE = @ARCHITECTURE@ 157 ARCH_FLAGS = @ARCH_FLAGS@ 157 158 AUTOCONF = @AUTOCONF@ 158 159 AUTOHEADER = @AUTOHEADER@ … … 169 170 CFA_INCDIR = @CFA_INCDIR@ 170 171 CFA_LIBDIR = @CFA_LIBDIR@ 172 CFA_NAME = @CFA_NAME@ 171 173 CFA_PREFIX = @CFA_PREFIX@ 172 174 CFLAGS = @CFLAGS@ … … 221 223 am__untar = @am__untar@ 222 224 bindir = @bindir@ 223 build = @build@224 225 build_alias = @build_alias@ 225 build_cpu = @build_cpu@226 build_os = @build_os@227 build_vendor = @build_vendor@228 226 builddir = @builddir@ 229 227 datadir = @datadir@ … … 232 230 dvidir = @dvidir@ 233 231 exec_prefix = @exec_prefix@ 234 host = @host@235 232 host_alias = @host_alias@ 236 host_cpu = @host_cpu@237 host_os = @host_os@238 host_vendor = @host_vendor@239 233 htmldir = @htmldir@ 240 234 includedir = @includedir@ … … 269 263 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cf bootloader.c 270 264 noinst_DATA = ../src/prelude.c 271 MAINTAINERCLEANFILES = gcc-builtins.c gcc-builtins.cf builtins.cf extras.cf bootloader.c prelude.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} 265 AM_CFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ 266 MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cf 267 MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} 272 268 all: all-am 273 269 … … 387 383 fi 388 384 mostlyclean-generic: 385 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 389 386 390 387 clean-generic: … … 490 487 # create extra forward types/declarations to reduce inclusion of library files 491 488 extras.cf : ${srcdir}/extras.regx ${srcdir}/extras.c 492 ${AM_V_GEN}gcc -E ${srcdir}/extras.c | grep -f ${srcdir}/extras.regx > extras.cf489 ${AM_V_GEN}gcc ${AM_CFLAGS} -E ${srcdir}/extras.c | grep -f ${srcdir}/extras.regx > extras.cf 493 490 494 491 # create forward declarations for gcc builtins … … 500 497 501 498 prelude.cf : prelude-gen.cc 502 ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${ <} -o prelude-gen -Wall -Wextra -O2 -g -std=c++14499 ${AM_V_GEN}${CXX} ${AM_CXXFLAGS} ${CXXFLAGS} ${AM_CFLAGS} ${<} -o prelude-gen -Wall -Wextra -O2 -g -std=c++14 503 500 @./prelude-gen > $@ 504 501 @rm ./prelude-gen … … 510 507 # create forward declarations for cfa builtins 511 508 builtins.cf : builtins.c ${CC} 512 ${AM_V_GEN} ${CC} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po509 ${AM_V_GEN}gcc ${AM_CFLAGS} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po 513 510 ${AM_V_at}sed -i 's/builtins.o/builtins.cf/g' $(DEPDIR)/builtins.Po 514 511 -
libcfa/src/Makefile.am
r4dcaed2 r37fe352 28 28 # use -no-include-stdhdr to prevent rebuild cycles 29 29 # The built sources must not depend on the installed headers 30 AM_CFAFLAGS = -quiet -no-include-stdhdr -XCFA -t -B@DRIVER_DIR@ -XCFA --prelude-dir=$(top_builddir)/prelude -imacros prelude.c -I$(srcdir)/stdhdr 31 AM_CFLAGS = -g -Wall -Wno-unused-function 30 AM_CFAFLAGS = -quiet -in-tree -B@DRIVER_DIR@ -XCFA --prelude-dir=$(top_builddir)/prelude -imacros prelude.c -I$(srcdir)/stdhdr 31 AM_CFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ 32 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ 32 33 CFACC = @CFACC@ 33 34 … … 43 44 44 45 # not all platforms support concurrency, add option do disable it 45 libsrc += concurrency/CtxSwitch-@ host_cpu@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa46 libsrc += concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa 46 47 47 48 # extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing -
libcfa/src/Makefile.in
r4dcaed2 r37fe352 91 91 PRE_UNINSTALL = : 92 92 POST_UNINSTALL = : 93 build_triplet = @build@94 host_triplet = @host@95 93 subdir = src 96 94 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 97 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 95 am__aclocal_m4_deps = $(top_srcdir)/../automake/cfa.m4 \ 96 $(top_srcdir)/configure.ac 98 97 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 99 98 $(ACLOCAL_M4) … … 151 150 interpose.$(OBJEXT) bits/debug.$(OBJEXT) assert.$(OBJEXT) \ 152 151 exception.$(OBJEXT) virtual.$(OBJEXT) heap.$(OBJEXT) \ 153 $(am__objects_1) concurrency/CtxSwitch-@host_cpu@.$(OBJEXT) \ 152 $(am__objects_1) \ 153 concurrency/CtxSwitch-@ARCHITECTURE@.$(OBJEXT) \ 154 154 concurrency/alarm.$(OBJEXT) concurrency/invoke.$(OBJEXT) \ 155 155 concurrency/preemption.$(OBJEXT) … … 223 223 AMTAR = @AMTAR@ 224 224 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 225 ARCHITECTURE = @ARCHITECTURE@ 226 ARCH_FLAGS = @ARCH_FLAGS@ 225 227 AUTOCONF = @AUTOCONF@ 226 228 AUTOHEADER = @AUTOHEADER@ … … 237 239 CFA_INCDIR = @CFA_INCDIR@ 238 240 CFA_LIBDIR = @CFA_LIBDIR@ 241 CFA_NAME = @CFA_NAME@ 239 242 CFA_PREFIX = @CFA_PREFIX@ 240 243 CFLAGS = @CFLAGS@ … … 289 292 am__untar = @am__untar@ 290 293 bindir = @bindir@ 291 build = @build@292 294 build_alias = @build_alias@ 293 build_cpu = @build_cpu@294 build_os = @build_os@295 build_vendor = @build_vendor@296 295 builddir = @builddir@ 297 296 datadir = @datadir@ … … 300 299 dvidir = @dvidir@ 301 300 exec_prefix = @exec_prefix@ 302 host = @host@303 301 host_alias = @host_alias@ 304 host_cpu = @host_cpu@305 host_os = @host_os@306 host_vendor = @host_vendor@307 302 htmldir = @htmldir@ 308 303 includedir = @includedir@ … … 344 339 # use -no-include-stdhdr to prevent rebuild cycles 345 340 # The built sources must not depend on the installed headers 346 AM_CFAFLAGS = -quiet -no-include-stdhdr -XCFA -t -B@DRIVER_DIR@ -XCFA --prelude-dir=$(top_builddir)/prelude -imacros prelude.c -I$(srcdir)/stdhdr 347 AM_CFLAGS = -g -Wall -Wno-unused-function 341 AM_CFAFLAGS = -quiet -in-tree -B@DRIVER_DIR@ -XCFA --prelude-dir=$(top_builddir)/prelude -imacros prelude.c -I$(srcdir)/stdhdr 342 AM_CFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ 343 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ 348 344 349 345 # not all platforms support concurrency, add option do disable it … … 357 353 libsrc = prelude.c startup.cfa interpose.cfa bits/debug.cfa assert.cfa \ 358 354 exception.c virtual.c heap.cfa ${headers:=.cfa} \ 359 concurrency/CtxSwitch-@ host_cpu@.S concurrency/alarm.cfa \355 concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa \ 360 356 concurrency/invoke.c concurrency/preemption.cfa 361 357 libcfa_a_SOURCES = ${libsrc} … … 479 475 concurrency/mutex.$(OBJEXT): concurrency/$(am__dirstamp) \ 480 476 concurrency/$(DEPDIR)/$(am__dirstamp) 481 concurrency/CtxSwitch-@ host_cpu@.$(OBJEXT): \477 concurrency/CtxSwitch-@ARCHITECTURE@.$(OBJEXT): \ 482 478 concurrency/$(am__dirstamp) \ 483 479 concurrency/$(DEPDIR)/$(am__dirstamp) … … 506 502 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prelude.Po@am__quote@ 507 503 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virtual.Po@am__quote@ 508 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@ host_cpu@.Po@am__quote@504 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@ARCHITECTURE@.Po@am__quote@ 509 505 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/invoke.Po@am__quote@ 510 506 -
src/config.h.in
r4dcaed2 r37fe352 1 1 /* src/config.h.in. Generated from configure.ac by autoheader. */ 2 3 /* CPU to use if the -m32 flags is given. */ 4 #undef CFA_32_CPU 5 6 /* CPU to use if the -m64 flags is given. */ 7 #undef CFA_64_CPU 2 8 3 9 /* Location of include files. */ … … 6 12 /* Location of cfa command. */ 7 13 #undef CFA_BINDIR 14 15 /* Default cpu to use if neither -m32 or -m64 are defined. */ 16 #undef CFA_DEFAULT_CPU 8 17 9 18 /* compilation flags for cfa libraries and test programs. */ -
src/main.cc
r4dcaed2 r37fe352 209 209 // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here. 210 210 211 assertf( (libcfap | treep) != PreludeDirector.empty(), "When building in treeoption --prelude-dir must be used." );211 assertf( !PreludeDirector.empty(), "Can't find prelude without option --prelude-dir must be used." ); 212 212 213 213 // Read to gcc builtins, if not generating the cfa library 214 FILE * gcc_builtins = fopen( libcfap | treep ? (PreludeDirector + "/gcc-builtins.cf").c_str() : CFA_LIBDIR "/gcc-builtins.cf", "r" );214 FILE * gcc_builtins = fopen( (PreludeDirector + "/gcc-builtins.cf").c_str(), "r" ); 215 215 assertf( gcc_builtins, "cannot open gcc-builtins.cf\n" ); 216 216 parse( gcc_builtins, LinkageSpec::Compiler ); 217 217 218 218 // read the extra prelude in, if not generating the cfa library 219 FILE * extras = fopen( libcfap | treep ? (PreludeDirector + "/extras.cf").c_str() : CFA_LIBDIR "/extras.cf", "r" );219 FILE * extras = fopen( (PreludeDirector + "/extras.cf").c_str(), "r" ); 220 220 assertf( extras, "cannot open extras.cf\n" ); 221 221 parse( extras, LinkageSpec::BuiltinC ); … … 223 223 if ( ! libcfap ) { 224 224 // read the prelude in, if not generating the cfa library 225 FILE * prelude = fopen( treep ? (PreludeDirector + "/prelude.cf").c_str() : CFA_LIBDIR "/prelude.cf", "r" );225 FILE * prelude = fopen( (PreludeDirector + "/prelude.cf").c_str(), "r" ); 226 226 assertf( prelude, "cannot open prelude.cf\n" ); 227 227 parse( prelude, LinkageSpec::Intrinsic ); 228 228 229 229 // Read to cfa builtins, if not generating the cfa library 230 FILE * builtins = fopen( libcfap | treep ? (PreludeDirector + "/builtins.cf").c_str() : CFA_LIBDIR "/builtins.cf", "r" );230 FILE * builtins = fopen( (PreludeDirector + "/builtins.cf").c_str(), "r" ); 231 231 assertf( builtins, "cannot open builtins.cf\n" ); 232 232 parse( builtins, LinkageSpec::BuiltinCFA ); … … 352 352 PASS( "codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) ); 353 353 354 CodeGen::FixMain::fix( *output, treep ? (PreludeDirector + "/bootloader.c").c_str() : CFA_LIBDIR "/bootloader.c");354 CodeGen::FixMain::fix( *output, (PreludeDirector + "/bootloader.c").c_str() ); 355 355 if ( output != &cout ) { 356 356 delete output;
Note: See TracChangeset
for help on using the changeset viewer.