PennMUSH Community

Changeset 1186

Show
Ignore:
Timestamp:
01/02/08 02:00:22 (8 months ago)
Author:
shawnw
Message:

#7484: Test for some more gcc and/or os/processor specific optimization flags

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/branches/devel/CHANGES.183

    r1166 r1186  
    55chronological order (most recent first) 
    66 
    7 [TAP] is T. Alexander Popiel, a PennMUSH developer (aka Talek) 
    87[SW] is Shawn Wagner, a PennMUSH developer (aka Raevnos) 
    98[EEH] is Ervin Hearn III, a PennMUSH developer (aka Noltar) 
     
    1211[MUX] refers to code by (or inspired by) TinyMUX 2.x 
    1312[Rhost] refers to code by (or inspired by) RhostMUSH 
     13[TAP] is T. Alexander Popiel, a former PennMUSH developer (aka Talek) 
    1414 
    1515========================================================================== 
     16 
     17Version 1.8.3 patchlevel 7                      ??? ??, 2008 
     18 
     19Minor changes: 
     20 * If compiling with a recent enough version of gcc to support the 
     21   -fstack-protector option to detect buffer overruns, use it. 
     22 * Compile with -mdynamic-no-pic on powerpc OS X, resulting in a smaller 
     23   binary. 
    1624 
    1725Version 1.8.3 patchlevel 6                      Jan 01, 2008 
  • 1.8.3/branches/devel/configure

    r1179 r1186  
    655655build_vendor 
    656656build_os 
    657 host 
    658 host_cpu 
    659 host_vendor 
    660 host_os 
    661657CAT 
    662658CC 
     
    12771273System types: 
    12781274  --build=BUILD     configure for building on BUILD [guessed] 
    1279   --host=HOST       cross-compile to build programs to run on HOST [BUILD] 
    12801275_ACEOF 
    12811276fi 
     
    18181813 
    18191814 
    1820 { echo "$as_me:$LINENO: checking host system type" >&5 
    1821 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } 
    1822 if test "${ac_cv_host+set}" = set; then 
    1823   echo $ECHO_N "(cached) $ECHO_C" >&6 
    1824 else 
    1825   if test "x$host_alias" = x; then 
    1826   ac_cv_host=$ac_cv_build 
    1827 else 
    1828   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || 
    1829     { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 
    1830 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} 
    1831    { (exit 1); exit 1; }; } 
    1832 fi 
    1833  
    1834 fi 
    1835 { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 
    1836 echo "${ECHO_T}$ac_cv_host" >&6; } 
    1837 case $ac_cv_host in 
    1838 *-*-*) ;; 
    1839 *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 
    1840 echo "$as_me: error: invalid value of canonical host" >&2;} 
    1841    { (exit 1); exit 1; }; };; 
    1842 esac 
    1843 host=$ac_cv_host 
    1844 ac_save_IFS=$IFS; IFS='-' 
    1845 set x $ac_cv_host 
    1846 shift 
    1847 host_cpu=$1 
    1848 host_vendor=$2 
    1849 shift; shift 
    1850 # Remember, the first character of IFS is used to create $*, 
    1851 # except with old shells: 
    1852 host_os=$* 
    1853 IFS=$ac_save_IFS 
    1854 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac 
    1855  
    1856  
    18571815 
    18581816if test "x$CFLAGS" = "x"; then 
     
    30703028echo "${ECHO_T}no" >&6; } 
    30713029fi 
    3072  
    3073  
    3074  
    3075 # Set good debug and warning options if using gcc 
    3076 # and custom CFLAGS aren't being used. 
    3077 # Todo: Look into the warnings setting macros in the autoconf archive, 
    3078 # maybe use them instead? 
    3079 if test $DEFAULT_CFLAGS = yes; then 
    3080  if test "x$GDB" != x; then 
    3081   if test "x$ac_cv_c_compiler_gnu" = xyes; then 
    3082 CFLAGS="-ggdb $CFLAGS -W -Wall -pedantic -Wno-comment" 
    3083    else 
    3084 CFLAGS="-g $CFLAGS -W" 
    3085   fi 
    3086  else 
    3087 CFLAGS="-g $CFLAGS -W" 
    3088  fi 
    3089 fi 
    3090  
    3091  
    3092  
    3093  
    3094   { echo "$as_me:$LINENO: checking if gcc accepts -fstack-protector option" >&5 
    3095 echo $ECHO_N "checking if gcc accepts -fstack-protector option... $ECHO_C" >&6; } 
    3096  
    3097   if  test "x$GCC" = "xyes" ; then 
    3098  
    3099     if  test -z "" ; then 
    3100  
    3101       ax_gcc_option_test="int main() 
    3102 { 
    3103     return 0; 
    3104 }" 
    3105  
    3106 else 
    3107  
    3108       ax_gcc_option_test="" 
    3109  
    3110 fi 
    3111  
    3112  
    3113     # Dump the test program to file 
    3114     cat <<EOF > conftest.c 
    3115 $ax_gcc_option_test 
    3116 EOF 
    3117  
    3118     # Dump back the file to the log, useful for debugging purposes 
    3119     { ac_try='cat conftest.c 1>&5' 
    3120   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
    3121   (eval $ac_try) 2>&5 
    3122   ac_status=$? 
    3123   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    3124   (exit $ac_status); }; } 
    3125  
    3126     if  { ac_try='$CC  -fstack-protector -c conftest.c 1>&5' 
    3127   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
    3128   (eval $ac_try) 2>&5 
    3129   ac_status=$? 
    3130   echo "$as_me:$LINENO: \$? = $ac_status" >&5 
    3131   (exit $ac_status); }; } ; then 
    3132  
    3133             { echo "$as_me:$LINENO: result: yes" >&5 
    3134 echo "${ECHO_T}yes" >&6; } 
    3135  
    3136                    CFLAGS="$CFLAGS -fstack-protector" 
    3137  
    3138  
    3139 else 
    3140  
    3141         { echo "$as_me:$LINENO: result: no" >&5 
    3142 echo "${ECHO_T}no" >&6; } 
    3143  
    3144  
    3145 fi 
    3146  
    3147  
    3148 else 
    3149  
    3150     { echo "$as_me:$LINENO: result: no gcc available" >&5 
    3151 echo "${ECHO_T}no gcc available" >&6; } 
    3152  
    3153 fi 
    3154  
    3155  
    31563030 
    31573031 
     
    37273601fi 
    37283602 
     3603 
     3604 
     3605# Set good debug and warning options if using gcc 
     3606# and custom CFLAGS aren't being used. 
     3607# Todo: Look into the warnings setting macros in the autoconf archive, 
     3608# maybe use them instead? 
     3609if test $DEFAULT_CFLAGS = yes; then 
     3610 if test "x$GDB" != x; then 
     3611  if test "x$ac_cv_c_compiler_gnu" = xyes; then 
     3612CFLAGS="-ggdb $CFLAGS -W -Wall -pedantic -Wno-comment" 
     3613   else 
     3614CFLAGS="-g $CFLAGS -W" 
     3615  fi 
     3616 else 
     3617CFLAGS="-g $CFLAGS -W" 
     3618 fi 
     3619fi 
     3620 
     3621 
     3622 
     3623 
     3624  { echo "$as_me:$LINENO: checking if gcc accepts -fstack-protector option" >&5 
     3625echo $ECHO_N "checking if gcc accepts -fstack-protector option... $ECHO_C" >&6; } 
     3626 
     3627  if  test "x$GCC" = "xyes" ; then 
     3628 
     3629    if  test -z "" ; then 
     3630 
     3631      ax_gcc_option_test="int main() 
     3632{ 
     3633    return 0; 
     3634}" 
     3635 
     3636else 
     3637 
     3638      ax_gcc_option_test="" 
     3639 
     3640fi 
     3641 
     3642 
     3643    # Dump the test program to file 
     3644    cat <<EOF > conftest.c 
     3645$ax_gcc_option_test 
     3646EOF 
     3647 
     3648    # Dump back the file to the log, useful for debugging purposes 
     3649    { ac_try='cat conftest.c 1>&5' 
     3650  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3651  (eval $ac_try) 2>&5 
     3652  ac_status=$? 
     3653  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3654  (exit $ac_status); }; } 
     3655 
     3656    if  { ac_try='$CC  -fstack-protector -c conftest.c 1>&5' 
     3657  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3658  (eval $ac_try) 2>&5 
     3659  ac_status=$? 
     3660  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3661  (exit $ac_status); }; } ; then 
     3662 
     3663            { echo "$as_me:$LINENO: result: yes" >&5 
     3664echo "${ECHO_T}yes" >&6; } 
     3665 
     3666   CFLAGS="$CFLAGS -fstack-protector" 
     3667 
     3668 
     3669else 
     3670 
     3671        { echo "$as_me:$LINENO: result: no" >&5 
     3672echo "${ECHO_T}no" >&6; } 
     3673 
     3674 
     3675fi 
     3676 
     3677 
     3678else 
     3679 
     3680    { echo "$as_me:$LINENO: result: no gcc available" >&5 
     3681echo "${ECHO_T}no gcc available" >&6; } 
     3682 
     3683fi 
     3684 
     3685 
     3686 
     3687if test $build_os = darwin -a $build_cpu = powerpc; then 
     3688 
     3689 
     3690 
     3691  { echo "$as_me:$LINENO: checking if gcc accepts -mdynamic-no-pic option" >&5 
     3692echo $ECHO_N "checking if gcc accepts -mdynamic-no-pic option... $ECHO_C" >&6; } 
     3693 
     3694  if  test "x$GCC" = "xyes" ; then 
     3695 
     3696    if  test -z "" ; then 
     3697 
     3698      ax_gcc_option_test="int main() 
     3699{ 
     3700    return 0; 
     3701}" 
     3702 
     3703else 
     3704 
     3705      ax_gcc_option_test="" 
     3706 
     3707fi 
     3708 
     3709 
     3710    # Dump the test program to file 
     3711    cat <<EOF > conftest.c 
     3712$ax_gcc_option_test 
     3713EOF 
     3714 
     3715    # Dump back the file to the log, useful for debugging purposes 
     3716    { ac_try='cat conftest.c 1>&5' 
     3717  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3718  (eval $ac_try) 2>&5 
     3719  ac_status=$? 
     3720  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3721  (exit $ac_status); }; } 
     3722 
     3723    if  { ac_try='$CC  -mdynamic-no-pic -c conftest.c 1>&5' 
     3724  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 
     3725  (eval $ac_try) 2>&5 
     3726  ac_status=$? 
     3727  echo "$as_me:$LINENO: \$? = $ac_status" >&5 
     3728  (exit $ac_status); }; } ; then 
     3729 
     3730            { echo "$as_me:$LINENO: result: yes" >&5 
     3731echo "${ECHO_T}yes" >&6; } 
     3732 
     3733     CFLAGS="$CFLAGS -mdynamic-no-pic" 
     3734 
     3735 
     3736else 
     3737 
     3738        { echo "$as_me:$LINENO: result: no" >&5 
     3739echo "${ECHO_T}no" >&6; } 
     3740 
     3741 
     3742fi 
     3743 
     3744 
     3745else 
     3746 
     3747    { echo "$as_me:$LINENO: result: no gcc available" >&5 
     3748echo "${ECHO_T}no gcc available" >&6; } 
     3749 
     3750fi 
     3751 
     3752 
     3753fi 
    37293754 
    37303755 
     
    1704817073build_vendor!$build_vendor$ac_delim 
    1704917074build_os!$build_os$ac_delim 
    17050 host!$host$ac_delim 
    17051 host_cpu!$host_cpu$ac_delim 
    17052 host_vendor!$host_vendor$ac_delim 
    17053 host_os!$host_os$ac_delim 
    1705417075CAT!$CAT$ac_delim 
    1705517076CC!$CC$ac_delim 
     
    1710017121_ACEOF 
    1710117122 
    17102   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then 
     17123  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 87; then 
    1710317124    break 
    1710417125  elif $ac_last_try; then 
  • 1.8.3/branches/devel/configure.in

    r1179 r1186  
    77AC_INIT(configure.in) 
    88AC_CONFIG_HEADERS(config.h) 
    9 AC_CANONICAL_HOST 
     9AC_CANONICAL_BUILD 
    1010 
    1111if test "x$CFLAGS" = "x"; then 
     
    2424AC_PROG_CC_C99 
    2525AC_PATH_PROG(GDB, gdb) 
    26  
    27 # Set good debug and warning options if using gcc 
    28 # and custom CFLAGS aren't being used. 
    29 # Todo: Look into the warnings setting macros in the autoconf archive, 
    30 # maybe use them instead? 
    31 if test $DEFAULT_CFLAGS = yes; then 
    32  if test "x$GDB" != x; then 
    33   if test "x$ac_cv_c_compiler_gnu" = xyes; then 
    34 CFLAGS="-ggdb $CFLAGS -W -Wall -pedantic -Wno-comment" 
    35    else 
    36 CFLAGS="-g $CFLAGS -W" 
    37   fi 
    38  else 
    39 CFLAGS="-g $CFLAGS -W" 
    40  fi 
    41 fi 
    42  
    43 AX_GCC_OPTION([-fstack-protector], [], [], [ 
    44                    CFLAGS="$CFLAGS -fstack-protector" 
    45                    ], []) 
    46                     
    47  
    4826AC_PATH_PROG(CHMOD, chmod) 
    4927AC_PATH_PROG(CP, cp) 
     
    6139AC_PATH_PROG(ETAGS, etags) 
    6240AC_PATH_PROG(EXCTAGS, exctags) 
     41 
     42# Set good debug and warning options if using gcc 
     43# and custom CFLAGS aren't being used. 
     44# Todo: Look into the warnings setting macros in the autoconf archive, 
     45# maybe use them instead? 
     46if test $DEFAULT_CFLAGS = yes; then 
     47 if test "x$GDB" != x; then 
     48  if test "x$ac_cv_c_compiler_gnu" = xyes; then 
     49CFLAGS="-ggdb $CFLAGS -W -Wall -pedantic -Wno-comment" 
     50   else 
     51CFLAGS="-g $CFLAGS -W" 
     52  fi 
     53 else 
     54CFLAGS="-g $CFLAGS -W" 
     55 fi 
     56fi 
     57 
     58AX_GCC_OPTION([-fstack-protector], [], [], [ 
     59   CFLAGS="$CFLAGS -fstack-protector" 
     60], []) 
     61                    
     62if test $build_os = darwin -a $build_cpu = powerpc; then 
     63  AX_GCC_OPTION([-mdynamic-no-pic], [], [], [ 
     64     CFLAGS="$CFLAGS -mdynamic-no-pic" 
     65  ], []) 
     66fi 
     67 
    6368 
    6469if test "x$CTAGS" = x -a "x$EXCTAGS" != x; then