Gentoo Archives: gentoo-lisp

From: "Marijn Schouten (hkBst)" <hkBst@g.o>
To: yann@××××××.edu
Cc: gentoo-lisp@l.g.o
Subject: [gentoo-lisp] lush: tricks concerning CFLAGS and target architecture
Date: Mon, 24 Sep 2007 13:19:35
Message-Id: 46F7B869.7030403@gentoo.org
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Hello Yann,
5
6 I write to you concerning Lush as I couldn't find an email address
7 specifically for it...
8
9 I would like you to consider dropping all the tricks concerning CFLAGS and
10 target architecture that are now employed by Lush. Do you really know what
11 CFLAGS are acceptable on a dozen arches? Apparently not as the current default
12 is warned against if you use Mandriva.
13
14 "
15 ** IMPORTANT NOTE to Mandrake 9.2 Users: before compiling, edit
16 lush/src/Makefile and replace "-O3" by "-O2" in the line that
17 begins with "OPTS=" or Lush may crash.
18 "
19
20 I guess that is because that version of Mandriva uses >=gcc-4, so that warning
21 is pathetically ill-targeted.
22
23 I am currently using the following patch to fix some of the issues, but I am
24 sure you is easy enough for you to rip out the whole of AC_DEFUN(AC_CC_OPTIMIZE.
25
26 - --- aclocal.m4.old 2007-09-18 19:07:48.000000000 +0200
27 +++ aclocal.m4 2007-09-18 19:15:29.000000000 +0200
28 @@ -102,49 +102,49 @@
29 [ac_cpu=$withval])
30
31 AC_ARG_VAR(OPTS, [Optimization flags for all compilers.])
32 - - if test x${OPTS+set} = xset ; then
33 - - saved_CFLAGS="$CFLAGS"
34 - - CFLAGS=
35 - - for opt in $saved_CFLAGS ; do
36 - - case $opt in
37 - - -O*|-g*) ;;
38 - - *) CFLAGS="$CFLAGS $opt" ;;
39 - - esac
40 - - done
41 - - AC_MSG_CHECKING([user provided debugging flags])
42 +# if test x${OPTS+set} = xset ; then
43 +# saved_CFLAGS="$CFLAGS"
44 +# CFLAGS=
45 +# for opt in $saved_CFLAGS ; do
46 +# case $opt in
47 +# -O*|-g*) ;;
48 +# *) CFLAGS="$CFLAGS $opt" ;;
49 +# esac
50 +# done
51 +# AC_MSG_CHECKING([user provided debugging flags])
52 AC_MSG_RESULT($OPTS)
53 - - else
54 - - saved_CFLAGS="$CFLAGS"
55 - - CFLAGS=
56 - - for opt in $saved_CFLAGS ; do
57 - - case $opt in
58 - - -O*) ;;
59 - - -g*) OPTS="$OPTS $opt" ;;
60 - - *) CFLAGS="$CFLAGS $opt" ;;
61 - - esac
62 - - done
63 +# else
64 +# saved_CFLAGS="$CFLAGS"
65 +# CFLAGS=
66 +# for opt in $saved_CFLAGS ; do
67 +# case $opt in
68 +# -O*) ;;
69 +# -g*) OPTS="$OPTS $opt" ;;
70 +# *) CFLAGS="$CFLAGS $opt" ;;
71 +# esac
72 +# done
73 if test x$ac_debug = xno ; then
74 OPTS=-DNO_DEBUG
75 - - AC_CHECK_CC_OPT([-Wall],[OPTS="$OPTS -Wall"])
76 - - AC_CHECK_CC_OPT([-O3],[OPTS="$OPTS -O3"],
77 - - [ AC_CHECK_CC_OPT([-O2], [OPTS="$OPTS -O2"] ) ] )
78 - - if test -z "$ac_cpu" ; then
79 - - AC_MSG_WARN([guessing cpu type (use --with-cpu=cpuname to override.)])
80 - - fi
81 - - opt="-march=${ac_cpu-${host_cpu}}"
82 - - AC_CHECK_CC_OPT([$opt], [OPTS="$OPTS $opt"],
83 - - [ opt="-mcpu=${ac_cpu-${host_cpu}}"
84 - - AC_CHECK_CC_OPT([$opt], [OPTS="$OPTS $opt"]) ] )
85 - - if test -z "$ac_cpu" -a "$host_cpu" = "i686" ; then
86 - - AC_CHECK_CC_OPT([-mmmx],[OPTS="$OPTS -mmmx"
87 - - AC_MSG_WARN([use --with-cpu=cpuname to avoid assuming that MMX
88 works.])])
89 - - if test -r /proc/cpuinfo && grep -q sse /proc/cpuinfo ; then
90 - - AC_CHECK_CC_OPT([-msse],[OPTS="$OPTS -msse"
91 - - AC_MSG_WARN([use --with-cpu=cpuname to avoid assuming that
92 SSE works.])])
93 - - fi
94 - - fi
95 +# AC_CHECK_CC_OPT([-Wall],[OPTS="$OPTS -Wall"])
96 +# AC_CHECK_CC_OPT([-O3],[OPTS="$OPTS -O3"],
97 +# [ AC_CHECK_CC_OPT([-O2], [OPTS="$OPTS -O2"] ) ] )
98 +# if test -z "$ac_cpu" ; then
99 +# AC_MSG_WARN([guessing cpu type (use --with-cpu=cpuname to override.)])
100 +# fi
101 +# opt="-march=${ac_cpu-${host_cpu}}"
102 +# AC_CHECK_CC_OPT([$opt], [OPTS="$OPTS $opt"],
103 +# [ opt="-mcpu=${ac_cpu-${host_cpu}}"
104 +# AC_CHECK_CC_OPT([$opt], [OPTS="$OPTS $opt"]) ] )
105 +# if test -z "$ac_cpu" -a "$host_cpu" = "i686" ; then
106 +# AC_CHECK_CC_OPT([-mmmx],[OPTS="$OPTS -mmmx"
107 +# AC_MSG_WARN([use --with-cpu=cpuname to avoid assuming that MMX
108 works.])])
109 +# if test -r /proc/cpuinfo && grep -q sse /proc/cpuinfo ; then
110 +# AC_CHECK_CC_OPT([-msse],[OPTS="$OPTS -msse"
111 +# AC_MSG_WARN([use --with-cpu=cpuname to avoid assuming that
112 SSE works.])])
113 +# fi
114 +# fi
115 fi
116 - - fi
117 +# fi
118 ])
119
120 Thank you,
121
122 Marijn
123
124 - --
125 Marijn Schouten (hkBst), Gentoo Lisp project
126 <http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode
127 -----BEGIN PGP SIGNATURE-----
128 Version: GnuPG v2.0.7 (GNU/Linux)
129 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
130
131 iD8DBQFG97hpp/VmCx0OL2wRAgT2AKCtiYY3+1IB53zeinxP/KCxwwDlzQCdFQLe
132 Yf5CZ6He/9Q4k+bZcbJr1Ws=
133 =WMqB
134 -----END PGP SIGNATURE-----
135 --
136 gentoo-lisp@g.o mailing list