~ubuntu-branches/ubuntu/precise/soqt/precise

« back to all changes in this revision

Viewing changes to cfg/m4/misc_compiler.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2004-10-11 22:00:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041011220026-s682y1my72drwkkh
Tags: 1.2.0-2
configure: Don't quote "$LD", it breaks the build.  
Closes: #269669, 274275.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#   Use this file to store miscellaneous macros related to checking
2
 
#   compiler features.
3
 
 
4
 
############################################################################
5
 
# Usage:
6
 
#   SIM_AC_CC_COMPILER_OPTION(OPTION-TO-TEST, ACTION-IF-TRUE [, ACTION-IF-FALSE])
7
 
#   SIM_AC_CXX_COMPILER_OPTION(OPTION-TO-TEST, ACTION-IF-TRUE [, ACTION-IF-FALSE])
8
 
#
9
 
# Description:
10
 
#
11
 
#   Check whether the current C or C++ compiler can handle a
12
 
#   particular command-line option.
13
 
#
14
 
#
15
 
# Author: Morten Eriksen, <mortene@sim.no>.
16
 
#
17
 
#   * [mortene:19991218] improve macros by catching and analyzing
18
 
#     stderr (at least to see if there was any output there)?
19
 
#
20
 
 
21
 
AC_DEFUN([SIM_AC_COMPILER_OPTION], [
22
 
sim_ac_save_cppflags=$CPPFLAGS
23
 
CPPFLAGS="$CPPFLAGS $1"
24
 
AC_TRY_COMPILE([], [], [sim_ac_accept_result=yes], [sim_ac_accept_result=no])
25
 
AC_MSG_RESULT([$sim_ac_accept_result])
26
 
CPPFLAGS=$sim_ac_save_cppflags
27
 
# This need to go last, in case CPPFLAGS is modified in $2 or $3.
28
 
if test $sim_ac_accept_result = yes; then
29
 
  ifelse($2, , :, $2)
30
 
else
31
 
  ifelse($3, , :, $3)
32
 
fi
33
 
])
34
 
 
35
 
AC_DEFUN([SIM_AC_CC_COMPILER_OPTION], [
36
 
AC_LANG_SAVE
37
 
AC_LANG_C
38
 
AC_MSG_CHECKING([whether $CC accepts $1])
39
 
SIM_AC_COMPILER_OPTION($1, $2, $3)
40
 
AC_LANG_RESTORE
41
 
])
42
 
 
43
 
AC_DEFUN([SIM_AC_CXX_COMPILER_OPTION], [
44
 
AC_LANG_SAVE
45
 
AC_LANG_CPLUSPLUS
46
 
AC_MSG_CHECKING([whether $CXX accepts $1])
47
 
SIM_AC_COMPILER_OPTION($1, $2, $3)
48
 
AC_LANG_RESTORE
49
 
])