Search
lxdream.org :: lxdream/m4/ccforbuild.m4
lxdream 0.9.1
released Jun 29
Download Now
filename m4/ccforbuild.m4
changeset 1293:36123decfb24
prev1211:eecdeb37934a
author nkeynes
date Sat Aug 25 14:09:07 2012 +1000 (7 years ago)
permissions -rw-r--r--
last change Subst LDFLAGS_FOR_BUILD in configure
view annotate diff log raw
     1 AC_DEFUN([AC_PUSH_CC_FOR_BUILD], [dnl
     2 pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
     3 pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
     4 pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
     5 pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
     6 pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
     7 pushdef([ac_cv_prog_cc_stdc], ac_cv_build_prog_cc_stdc)dnl
     8 pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_stdc)dnl
     9 pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_stdc)dnl
    10 dnl pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)dnl
    11 pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
    12 pushdef([ac_cv_objext], ac_cv_build_objext)dnl
    13 pushdef([ac_exeext], ac_build_exeext)dnl
    14 pushdef([ac_objext], ac_build_objext)dnl
    15 pushdef([CC], CC_FOR_BUILD)dnl
    16 pushdef([CPP], CPP_FOR_BUILD)dnl
    17 pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
    18 pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
    19 pushdef([host], build)dnl
    20 pushdef([host_alias], build_alias)dnl
    21 pushdef([host_cpu], build_cpu)dnl
    22 pushdef([host_vendor], build_vendor)dnl
    23 pushdef([host_os], build_os)dnl
    24 pushdef([ac_compiler_gnu], ac_build_compiler_gnu)dnl
    25 pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl
    26 pushdef([ac_cv_host], ac_cv_build)dnl
    27 pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
    28 pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
    29 pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
    30 pushdef([ac_cv_host_os], ac_cv_build_os)dnl
    31 pushdef([ac_cpp], ac_build_cpp)dnl
    32 pushdef([ac_compile], ac_build_compile)dnl
    33 pushdef([ac_link], ac_build_link)dnl
    34 ])
    36 AC_DEFUN([AC_POP_CC_FOR_BUILD], [dnl
    37 popdef([ac_link])dnl
    38 popdef([ac_compile])dnl
    39 popdef([ac_cpp])dnl
    40 popdef([ac_cv_host_os])dnl
    41 popdef([ac_cv_host_vendor])dnl
    42 popdef([ac_cv_host_cpu])dnl
    43 popdef([ac_cv_host_alias])dnl
    44 popdef([ac_cv_host])dnl
    45 popdef([ac_tool_prefix])dnl
    46 popdef([ac_compiler_gnu])dnl
    47 popdef([host_os])dnl
    48 popdef([host_vendor])dnl
    49 popdef([host_cpu])dnl
    50 popdef([host_alias])dnl
    51 popdef([host])dnl
    52 popdef([CPPFLAGS])dnl
    53 popdef([CFLAGS])dnl
    54 popdef([CPP])dnl
    55 popdef([CC])dnl
    56 popdef([ac_objext])dnl
    57 popdef([ac_exeext])dnl
    58 popdef([ac_cv_objext])dnl
    59 popdef([ac_cv_exeext])dnl
    60 dnl popdef([ac_cv_c_compiler_gnu])dnl
    61 popdef([ac_cv_prog_cc_c89])dnl
    62 popdef([ac_cv_prog_cc_c99])dnl
    63 popdef([ac_cv_prog_cc_stdc])dnl
    64 popdef([ac_cv_prog_cc_g])dnl
    65 popdef([ac_cv_prog_cc_works])dnl
    66 popdef([ac_cv_prog_cc_cross])dnl
    67 popdef([ac_cv_prog_gcc])dnl
    68 popdef([ac_cv_prog_CPP])dnl
    69 ])
    72 AC_DEFUN([AC_PROG_CC_FOR_BUILD], [dnl
    73 AC_REQUIRE([AC_PROG_CC])dnl
    74 AC_REQUIRE([AC_PROG_CPP])dnl
    75 AC_REQUIRE([AC_EXEEXT])dnl
    76 AC_REQUIRE([AC_CANONICAL_HOST])dnl
    77 dnl
    78 ac_main_cc="$CC"
    79 test -n "$build_alias" && ac_build_tool_prefix=$build_alias-
    81 pushdef([cross_compiling], [#])dnl
    82 dnl If main compiler works and CC_FOR_BUILD is unset, use the main compiler
    83 if test -z "$CC_FOR_BUILD"; then
    84     AC_RUN_IFELSE([int main(){return 0;}], [CC_FOR_BUILD="$CC"], [],[])
    85 fi
    86 dnl Use the standard macros, but make them use other variable names
    87 dnl
    88 AC_PUSH_CC_FOR_BUILD
    90 AC_PROG_CC
    91 AC_PROG_CC_STDC
    92 AC_PROG_CPP
    93 AC_EXEEXT
    95 dnl Restore the old definitions
    96 dnl
    97 AC_POP_CC_FOR_BUILD
    98 popdef([cross_compiling])dnl
    99 dnl Finally, set Makefile variables
   100 dnl
   101 BUILD_EXEEXT=$ac_build_exeext
   102 BUILD_OBJEXT=$ac_build_objext
   103 AC_SUBST(BUILD_EXEEXT)dnl
   104 AC_SUBST(BUILD_OBJEXT)dnl
   105 AC_SUBST([CFLAGS_FOR_BUILD])dnl
   106 AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
   107 AC_SUBST([LDFLAGS_FOR_BUILD])dnl
   108 ])
.