Changeset 9def87a for configure.ac


Ignore:
Timestamp:
Dec 8, 2016, 5:44:46 PM (8 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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
164d036
Parents:
57f408e
Message:

Added macros to select build target in configure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r57f408e r9def87a  
    5252AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.])
    5353AC_SUBST(CFA_BACKEND_CC)
     54
     55
     56
     57AC_ARG_ENABLE(target-release, AS_HELP_STRING([--enable-target-release], [Build and install the release target]))
     58AC_ARG_ENABLE(target-debug, AS_HELP_STRING([--enable-target-debug], [Build and install the debug target]))
     59
     60case "$enable_target_release" in
     61        yes)
     62                case "$enable_target_debug" in
     63                        yes)
     64                                build_release="yes"
     65                                build_debug="yes"
     66                                ;;
     67                        no)
     68                                build_release="yes"
     69                                build_debug="no"
     70                                ;;
     71                        *)
     72                                build_release="yes"
     73                                build_debug="no"
     74                                ;;
     75                esac
     76                ;;
     77        no)
     78                case "$enable_target_debug" in
     79                        yes)
     80                                build_release="no"
     81                                build_debug="yes"
     82                                ;;
     83                        no)
     84                                AC_MSG_ERROR(Must build target debug or release)
     85                                exit 1;
     86                                ;;
     87                        *)
     88                                build_release="no"
     89                                build_debug="yes"
     90                                ;;
     91                esac
     92                ;;
     93        *)
     94                case "$enable_target_debug" in
     95                        yes)
     96                                build_release="no"
     97                                build_debug="yes"
     98                                ;;
     99                        no)
     100                                build_release="yes"
     101                                build_debug="no"
     102                                ;;
     103                        *)
     104                                build_release="yes"
     105                                build_debug="yes"
     106                                ;;
     107                esac
     108                ;;
     109esac
     110
     111AM_CONDITIONAL([BUILD_RELEASE], [test "x$build_release" = "xyes"])
     112AM_CONDITIONAL([BUILD_DEBUG], [test "x$build_debug" = "xyes"])
    54113
    55114if test "x$prefix" = "xNONE"; then
     
    137196AC_OUTPUT
    138197
     198AM_COND_IF([BUILD_RELEASE],
     199        [AM_COND_IF([BUILD_DEBUG],
     200                [AC_MSG_NOTICE(Building libcfa for target: release & debug)],
     201                [AC_MSG_NOTICE(Building libcfa for target: release)])],
     202        [AC_MSG_NOTICE(Building libcfa for target: debug)])
     203
    139204# Final text
    140205AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".)
Note: See TracChangeset for help on using the changeset viewer.