Changeset 9def87a


Ignore:
Timestamp:
Dec 8, 2016, 5:44:46 PM (7 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

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • aclocal.m4

    r57f408e r9def87a  
    135135# expand $ac_aux_dir to an absolute path
    136136am_aux_dir=`cd $ac_aux_dir && pwd`
     137])
     138
     139# AM_COND_IF                                            -*- Autoconf -*-
     140
     141# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
     142#
     143# This file is free software; the Free Software Foundation
     144# gives unlimited permission to copy and/or distribute it,
     145# with or without modifications, as long as this notice is preserved.
     146
     147# serial 3
     148
     149# _AM_COND_IF
     150# _AM_COND_ELSE
     151# _AM_COND_ENDIF
     152# --------------
     153# These macros are only used for tracing.
     154m4_define([_AM_COND_IF])
     155m4_define([_AM_COND_ELSE])
     156m4_define([_AM_COND_ENDIF])
     157
     158
     159# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
     160# ---------------------------------------
     161# If the shell condition COND is true, execute IF-TRUE, otherwise execute
     162# IF-FALSE.  Allow automake to learn about conditional instantiating macros
     163# (the AC_CONFIG_FOOS).
     164AC_DEFUN([AM_COND_IF],
     165[m4_ifndef([_AM_COND_VALUE_$1],
     166           [m4_fatal([$0: no such condition "$1"])])dnl
     167_AM_COND_IF([$1])dnl
     168if test -z "$$1_TRUE"; then :
     169  m4_n([$2])[]dnl
     170m4_ifval([$3],
     171[_AM_COND_ELSE([$1])dnl
     172else
     173  $3
     174])dnl
     175_AM_COND_ENDIF([$1])dnl
     176fi[]dnl
    137177])
    138178
  • configure

    r57f408e r9def87a  
    658658CFA_INCDIR
    659659CFA_PREFIX
     660BUILD_DEBUG_FALSE
     661BUILD_DEBUG_TRUE
     662BUILD_RELEASE_FALSE
     663BUILD_RELEASE_TRUE
    660664CFA_BACKEND_CC
    661665BACKEND_CC
     
    734738enable_maintainer_mode
    735739with_backend_compiler
     740enable_target_release
     741enable_target_debug
    736742enable_dependency_tracking
    737743'
     
    13761382  --disable-maintainer-mode  disable make rules and dependencies not useful
    13771383                          (and sometimes confusing) to the casual installer
     1384  --enable-target-release Build and install the release target
     1385  --enable-target-debug   Build and install the debug target
    13781386  --disable-dependency-tracking  speeds up one-time build
    13791387  --enable-dependency-tracking   do not reject slow dependency extractors
     
    30993107_ACEOF
    31003108
     3109
     3110
     3111
     3112
     3113# Check whether --enable-target-release was given.
     3114if test "${enable_target_release+set}" = set; then :
     3115  enableval=$enable_target_release;
     3116fi
     3117
     3118# Check whether --enable-target-debug was given.
     3119if test "${enable_target_debug+set}" = set; then :
     3120  enableval=$enable_target_debug;
     3121fi
     3122
     3123
     3124case "$enable_target_release" in
     3125        yes)
     3126                case "$enable_target_debug" in
     3127                        yes)
     3128                                build_release="yes"
     3129                                build_debug="yes"
     3130                                ;;
     3131                        no)
     3132                                build_release="yes"
     3133                                build_debug="no"
     3134                                ;;
     3135                        *)
     3136                                build_release="yes"
     3137                                build_debug="no"
     3138                                ;;
     3139                esac
     3140                ;;
     3141        no)
     3142                case "$enable_target_debug" in
     3143                        yes)
     3144                                build_release="no"
     3145                                build_debug="yes"
     3146                                ;;
     3147                        no)
     3148                                as_fn_error $? "Must build target debug or release" "$LINENO" 5
     3149                                exit 1;
     3150                                ;;
     3151                        *)
     3152                                build_release="no"
     3153                                build_debug="yes"
     3154                                ;;
     3155                esac
     3156                ;;
     3157        *)
     3158                case "$enable_target_debug" in
     3159                        yes)
     3160                                build_release="no"
     3161                                build_debug="yes"
     3162                                ;;
     3163                        no)
     3164                                build_release="yes"
     3165                                build_debug="no"
     3166                                ;;
     3167                        *)
     3168                                build_release="yes"
     3169                                build_debug="yes"
     3170                                ;;
     3171                esac
     3172                ;;
     3173esac
     3174
     3175 if test "x$build_release" = "xyes"; then
     3176  BUILD_RELEASE_TRUE=
     3177  BUILD_RELEASE_FALSE='#'
     3178else
     3179  BUILD_RELEASE_TRUE='#'
     3180  BUILD_RELEASE_FALSE=
     3181fi
     3182
     3183 if test "x$build_debug" = "xyes"; then
     3184  BUILD_DEBUG_TRUE=
     3185  BUILD_DEBUG_FALSE='#'
     3186else
     3187  BUILD_DEBUG_TRUE='#'
     3188  BUILD_DEBUG_FALSE=
     3189fi
    31013190
    31023191
     
    62076296if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
    62086297  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
     6298Usually this means the macro was only invoked conditionally." "$LINENO" 5
     6299fi
     6300if test -z "${BUILD_RELEASE_TRUE}" && test -z "${BUILD_RELEASE_FALSE}"; then
     6301  as_fn_error $? "conditional \"BUILD_RELEASE\" was never defined.
     6302Usually this means the macro was only invoked conditionally." "$LINENO" 5
     6303fi
     6304if test -z "${BUILD_DEBUG_TRUE}" && test -z "${BUILD_DEBUG_FALSE}"; then
     6305  as_fn_error $? "conditional \"BUILD_DEBUG\" was never defined.
    62096306Usually this means the macro was only invoked conditionally." "$LINENO" 5
    62106307fi
     
    75667663
    75677664
     7665if test -z "$BUILD_RELEASE_TRUE"; then :
     7666  if test -z "$BUILD_DEBUG_TRUE"; then :
     7667  { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: release & debug" >&5
     7668$as_echo "$as_me: Building libcfa for target: release & debug" >&6;}
     7669else
     7670  { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: release" >&5
     7671$as_echo "$as_me: Building libcfa for target: release" >&6;}
     7672fi
     7673else
     7674  { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: debug" >&5
     7675$as_echo "$as_me: Building libcfa for target: debug" >&6;}
     7676fi
     7677
    75687678# Final text
    75697679{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Cforall configuraton completed. Type \"make -j 8 install\"." >&5
  • 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.