Changeset 4dcaed2


Ignore:
Timestamp:
Aug 5, 2018, 1:13:35 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
37fe352
Parents:
534e4e4
Message:

Added prelude-dir argument for cfa-cpp

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • configure

    r534e4e4 r4dcaed2  
    32793279TOP_SRCDIR=$ac_pwd/$ac_confdir/
    32803280TOP_BUILDDIR=$ac_pwd/
    3281 PRELUDE_BUILDDIR=$ac_pwd/libcfa-x86_64-debug/prelude/
    32823281
    32833282
     
    32893288cat >>confdefs.h <<_ACEOF
    32903289#define TOP_BUILDDIR "$TOP_BUILDDIR"
    3291 _ACEOF
    3292 
    3293 
    3294 cat >>confdefs.h <<_ACEOF
    3295 #define PRELUDE_BUILDDIR "$PRELUDE_BUILDDIR"
    32963290_ACEOF
    32973291
  • configure.ac

    r534e4e4 r4dcaed2  
    9090TOP_SRCDIR=$ac_pwd/$ac_confdir/
    9191TOP_BUILDDIR=$ac_pwd/
    92 PRELUDE_BUILDDIR=$ac_pwd/libcfa-x86_64-debug/prelude/
    9392
    9493AC_DEFINE_UNQUOTED(TOP_SRCDIR, "$TOP_SRCDIR", [Top src directory])
    9594AC_DEFINE_UNQUOTED(TOP_BUILDDIR, "$TOP_BUILDDIR", [Top build directory])
    96 AC_DEFINE_UNQUOTED(PRELUDE_BUILDDIR, "$PRELUDE_BUILDDIR", [Directory where the prelude files are built])
    9795
    9896DRIVER_DIR=${TOP_BUILDDIR}driver/
  • libcfa/prelude/Makefile.am

    r534e4e4 r4dcaed2  
    5959
    6060../src/prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@
    61         ${AM_V_GEN}@CFACPP@ -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
     61        ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    6262
    6363bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@
    64         ${AM_V_GEN}@CFACPP@ -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     64        ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    6565
    6666maintainer-clean-local :
  • libcfa/prelude/Makefile.in

    r534e4e4 r4dcaed2  
    516516
    517517../src/prelude.c : prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@
    518         ${AM_V_GEN}@CFACPP@ -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
     518        ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    519519
    520520bootloader.c : ${srcdir}/bootloader.cf prelude.cf extras.cf gcc-builtins.cf builtins.cf @CFACPP@
    521         ${AM_V_GEN}@CFACPP@ -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     521        ${AM_V_GEN}@CFACPP@ --prelude-dir=${builddir} -tpm ${srcdir}/bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    522522
    523523maintainer-clean-local :
  • libcfa/src/Makefile.am

    r534e4e4 r4dcaed2  
    2828# use -no-include-stdhdr to prevent rebuild cycles
    2929# The built sources must not depend on the installed headers
    30 AM_CFAFLAGS = -quiet -no-include-stdhdr -XCFA -t -B@DRIVER_DIR@ -imacros prelude.c -I$(srcdir)/stdhdr
     30AM_CFAFLAGS = -quiet -no-include-stdhdr -XCFA -t -B@DRIVER_DIR@ -XCFA --prelude-dir=$(top_builddir)/prelude -imacros prelude.c -I$(srcdir)/stdhdr
    3131AM_CFLAGS = -g -Wall -Wno-unused-function
    3232CFACC = @CFACC@
     
    4343
    4444# not all platforms support concurrency, add option do disable it
    45 libsrc += concurrency/CtxSwitch-@host_alias@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa
     45libsrc += concurrency/CtxSwitch-@host_cpu@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa
    4646
    4747# extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing
  • libcfa/src/Makefile.in

    r534e4e4 r4dcaed2  
    151151        interpose.$(OBJEXT) bits/debug.$(OBJEXT) assert.$(OBJEXT) \
    152152        exception.$(OBJEXT) virtual.$(OBJEXT) heap.$(OBJEXT) \
    153         $(am__objects_1) concurrency/CtxSwitch-@host_alias@.$(OBJEXT) \
     153        $(am__objects_1) concurrency/CtxSwitch-@host_cpu@.$(OBJEXT) \
    154154        concurrency/alarm.$(OBJEXT) concurrency/invoke.$(OBJEXT) \
    155155        concurrency/preemption.$(OBJEXT)
     
    344344# use -no-include-stdhdr to prevent rebuild cycles
    345345# The built sources must not depend on the installed headers
    346 AM_CFAFLAGS = -quiet -no-include-stdhdr -XCFA -t -B@DRIVER_DIR@ -imacros prelude.c -I$(srcdir)/stdhdr
     346AM_CFAFLAGS = -quiet -no-include-stdhdr -XCFA -t -B@DRIVER_DIR@ -XCFA --prelude-dir=$(top_builddir)/prelude -imacros prelude.c -I$(srcdir)/stdhdr
    347347AM_CFLAGS = -g -Wall -Wno-unused-function
    348348
     
    357357libsrc = prelude.c startup.cfa interpose.cfa bits/debug.cfa assert.cfa \
    358358        exception.c virtual.c heap.cfa ${headers:=.cfa} \
    359         concurrency/CtxSwitch-@host_alias@.S concurrency/alarm.cfa \
     359        concurrency/CtxSwitch-@host_cpu@.S concurrency/alarm.cfa \
    360360        concurrency/invoke.c concurrency/preemption.cfa
    361361libcfa_a_SOURCES = ${libsrc}
     
    479479concurrency/mutex.$(OBJEXT): concurrency/$(am__dirstamp) \
    480480        concurrency/$(DEPDIR)/$(am__dirstamp)
    481 concurrency/CtxSwitch-@host_alias@.$(OBJEXT):  \
     481concurrency/CtxSwitch-@host_cpu@.$(OBJEXT):  \
    482482        concurrency/$(am__dirstamp) \
    483483        concurrency/$(DEPDIR)/$(am__dirstamp)
     
    506506@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prelude.Po@am__quote@
    507507@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virtual.Po@am__quote@
    508 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@host_alias@.Po@am__quote@
     508@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@host_cpu@.Po@am__quote@
    509509@AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/invoke.Po@am__quote@
    510510
  • src/config.h.in

    r534e4e4 r4dcaed2  
    141141/* Define to the version of this package. */
    142142#undef PACKAGE_VERSION
    143 
    144 /* Directory where the prelude files are built */
    145 #undef PRELUDE_BUILDDIR
    146143
    147144/* If using the C implementation of alloca, define if you know the
  • src/main.cc

    r534e4e4 r4dcaed2  
    9898        linemarks = false;
    9999
     100std::string PreludeDirector = "";
     101
    100102static void parse_cmdline( int argc, char *argv[], const char *& filename );
    101103static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false );
     
    207209                        // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here.
    208210
     211                        assertf( (libcfap | treep) != PreludeDirector.empty(), "When building in tree option --prelude-dir must be used." );
     212
    209213                        // Read to gcc builtins, if not generating the cfa library
    210                         FILE * gcc_builtins = fopen( libcfap | treep ? PRELUDE_BUILDDIR "/gcc-builtins.cf" : CFA_LIBDIR "/gcc-builtins.cf", "r" );
     214                        FILE * gcc_builtins = fopen( libcfap | treep ? (PreludeDirector + "/gcc-builtins.cf").c_str() : CFA_LIBDIR "/gcc-builtins.cf", "r" );
    211215                        assertf( gcc_builtins, "cannot open gcc-builtins.cf\n" );
    212216                        parse( gcc_builtins, LinkageSpec::Compiler );
    213217
    214218                        // read the extra prelude in, if not generating the cfa library
    215                         FILE * extras = fopen( libcfap | treep ? PRELUDE_BUILDDIR "/extras.cf" : CFA_LIBDIR "/extras.cf", "r" );
     219                        FILE * extras = fopen( libcfap | treep ? (PreludeDirector + "/extras.cf").c_str() : CFA_LIBDIR "/extras.cf", "r" );
    216220                        assertf( extras, "cannot open extras.cf\n" );
    217221                        parse( extras, LinkageSpec::BuiltinC );
     
    219223                        if ( ! libcfap ) {
    220224                                // read the prelude in, if not generating the cfa library
    221                                 FILE * prelude = fopen( treep ? PRELUDE_BUILDDIR "/prelude.cf" : CFA_LIBDIR "/prelude.cf", "r" );
     225                                FILE * prelude = fopen( treep ? (PreludeDirector + "/prelude.cf").c_str() : CFA_LIBDIR "/prelude.cf", "r" );
    222226                                assertf( prelude, "cannot open prelude.cf\n" );
    223227                                parse( prelude, LinkageSpec::Intrinsic );
    224228
    225229                                // Read to cfa builtins, if not generating the cfa library
    226                                 FILE * builtins = fopen( libcfap | treep ? PRELUDE_BUILDDIR "/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );
     230                                FILE * builtins = fopen( libcfap | treep ? (PreludeDirector + "/builtins.cf").c_str() : CFA_LIBDIR "/builtins.cf", "r" );
    227231                                assertf( builtins, "cannot open builtins.cf\n" );
    228232                                parse( builtins, LinkageSpec::BuiltinCFA );
     
    348352                PASS( "codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) );
    349353
    350                 CodeGen::FixMain::fix( *output, treep ? PRELUDE_BUILDDIR "/bootloader.c" : CFA_LIBDIR "/bootloader.c" );
     354                CodeGen::FixMain::fix( *output, treep ? (PreludeDirector + "/bootloader.c").c_str() : CFA_LIBDIR "/bootloader.c" );
    351355                if ( output != &cout ) {
    352356                        delete output;
     
    397401
    398402void parse_cmdline( int argc, char * argv[], const char *& filename ) {
    399         enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };
     403        enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };
    400404
    401405        static struct option long_opts[] = {
     
    413417                { "no-preamble", no_argument, 0, Nopreamble },
    414418                { "parse", no_argument, 0, Parse },
     419                { "prelude-dir", required_argument, 0, PreludeDir },
    415420                { "no-prototypes", no_argument, 0, Prototypes },
    416421                { "resolver", no_argument, 0, Resolver },
     
    485490                  case 'p':                                                                             // generate prototypes for preamble functions
    486491                        noprotop = true;
     492                        break;
     493                  case PreludeDir:
     494                        PreludeDirector = optarg;
    487495                        break;
    488496                  case 'm':                                                                             // don't replace the main
Note: See TracChangeset for help on using the changeset viewer.