cURL / Mailing Lists / curl-library / Single Mail

curl-library

Refinement to optimize options for Mac OS X

From: Daniel Johnson <daniel.johnson31_at_gmail.com>
Date: Sun, 12 Oct 2008 10:03:20 -0400

Mac OS X uses gcc but the preferred optimization setting is -Os
instead of -O2. Something like this would work:

Index: m4/curl-compilers.m4
===================================================================
RCS file: /cvsroot/curl/curl/m4/curl-compilers.m4,v
retrieving revision 1.23
diff -u -r1.23 curl-compilers.m4
--- m4/curl-compilers.m4 11 Oct 2008 18:04:39 -0000 1.23
+++ m4/curl-compilers.m4 12 Oct 2008 13:42:04 -0000
@@ -122,7 +122,12 @@
      flags_dbg_yes="-g"
      flags_dbg_off="-g0"
      flags_opt_all="-O -O0 -O1 -O2 -O3 -Os"
- flags_opt_yes="-O2"
+ CURL_CHECK_DEF([__APPLE__], [], [silent])
+ if test "$curl_cv_have_def___APPLE__" = "yes"; then
+ flags_opt_yes="-Os"
+ else
+ flags_opt_yes="-O2"
+ fi
      flags_opt_off="-O0"
    else
      AC_MSG_RESULT([no])

Daniel
Received on 2008-10-12