Changeset 25a9b5a


Ignore:
Timestamp:
Aug 2, 2018, 2:52:59 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:
c59712e
Parents:
bf71cfd
Message:

Added defines for prelude path in tree

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • configure

    rbf71cfd r25a9b5a  
    33883388
    33893389
     3390cat >>confdefs.h <<_ACEOF
     3391#define TOP_SRCDIR "$ac_pwd/$ac_confdir/"
     3392_ACEOF
     3393
     3394
     3395cat >>confdefs.h <<_ACEOF
     3396#define TOP_BUILDDIR "$ac_pwd/"
     3397_ACEOF
     3398
     3399
     3400cat >>confdefs.h <<_ACEOF
     3401#define PRELUDE_BUILDDIR "$ac_pwd/libcfa/prelude/"
     3402_ACEOF
     3403
     3404
    33903405# Flag variables needed to build in tree
    33913406LIBCFA_SRC='$(top_srcdir)/libcfa/src'
  • configure.ac

    rbf71cfd r25a9b5a  
    178178AC_SUBST(CFACC)
    179179AC_SUBST(CFACPP)
     180AC_DEFINE_UNQUOTED(TOP_SRCDIR, "$ac_pwd/$ac_confdir/", [Top src directory])
     181AC_DEFINE_UNQUOTED(TOP_BUILDDIR, "$ac_pwd/", [Top build directory])
     182AC_DEFINE_UNQUOTED(PRELUDE_BUILDDIR, "$ac_pwd/libcfa/prelude/", [Directory where the prelude files are built])
    180183
    181184# Flag variables needed to build in tree
  • src/config.h.in

    rbf71cfd r25a9b5a  
    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
    143146
    144147/* If using the C implementation of alloca, define if you know the
     
    152155/* Define to 1 if you have the ANSI C header files. */
    153156#undef STDC_HEADERS
     157
     158/* Top build directory */
     159#undef TOP_BUILDDIR
     160
     161/* Top src directory */
     162#undef TOP_SRCDIR
    154163
    155164/* Version number of package */
  • src/main.cc

    rbf71cfd r25a9b5a  
    208208
    209209                        // Read to gcc builtins, if not generating the cfa library
    210                         FILE * gcc_builtins = fopen( libcfap | treep ? "../prelude/gcc-builtins.cf" : CFA_LIBDIR "/gcc-builtins.cf", "r" );
     210                        FILE * gcc_builtins = fopen( libcfap | treep ? PRELUDE_BUILDDIR "/gcc-builtins.cf" : CFA_LIBDIR "/gcc-builtins.cf", "r" );
    211211                        assertf( gcc_builtins, "cannot open gcc-builtins.cf\n" );
    212212                        parse( gcc_builtins, LinkageSpec::Compiler );
    213213
    214214                        // read the extra prelude in, if not generating the cfa library
    215                         FILE * extras = fopen( libcfap | treep ? "../prelude/extras.cf" : CFA_LIBDIR "/extras.cf", "r" );
     215                        FILE * extras = fopen( libcfap | treep ? PRELUDE_BUILDDIR "/extras.cf" : CFA_LIBDIR "/extras.cf", "r" );
    216216                        assertf( extras, "cannot open extras.cf\n" );
    217217                        parse( extras, LinkageSpec::BuiltinC );
     
    219219                        if ( ! libcfap ) {
    220220                                // read the prelude in, if not generating the cfa library
    221                                 FILE * prelude = fopen( treep ? "../prelude/prelude.cf" : CFA_LIBDIR "/prelude.cf", "r" );
     221                                FILE * prelude = fopen( treep ? PRELUDE_BUILDDIR "/prelude.cf" : CFA_LIBDIR "/prelude.cf", "r" );
    222222                                assertf( prelude, "cannot open prelude.cf\n" );
    223223                                parse( prelude, LinkageSpec::Intrinsic );
    224224
    225225                                // Read to cfa builtins, if not generating the cfa library
    226                                 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );
     226                                FILE * builtins = fopen( libcfap | treep ? PRELUDE_BUILDDIR "/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );
    227227                                assertf( builtins, "cannot open builtins.cf\n" );
    228228                                parse( builtins, LinkageSpec::BuiltinCFA );
     
    348348                PASS( "codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) );
    349349
    350                 CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" );
     350                CodeGen::FixMain::fix( *output, treep ? PRELUDE_BUILDDIR "/bootloader.c" : CFA_LIBDIR "/bootloader.c" );
    351351                if ( output != &cout ) {
    352352                        delete output;
  • tests/Makefile.in

    rbf71cfd r25a9b5a  
    313313# however, here it is more complicated because it must match the dependencies based on how
    314314# they are generated by gcc
    315 headers = $(shell find $(top_srcdir)/src/libcfa -type f ! -name "*.*")
    316 headers_real = $(shell realpath --relative-to=$(top_srcdir)/src/libcfa $(headers))
     315headers = $(shell find $(top_srcdir)/libcfa/src -type f ! -name "*.*")
     316headers_real = $(shell realpath --relative-to=$(top_srcdir)/libcfa/src $(headers))
    317317headers_deps = $(addprefix %/, $(headers_real))
    318318all: all-am
Note: See TracChangeset for help on using the changeset viewer.