This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Mac OS X compiling


Ryan,
All,

Sorry for the delay, I've been a bit busy lately...

On Monday 16 November 2009 23:43:24 Ryan Govostes wrote:
> I'm attaching a patch to the configure script. Since I'm not too familiar
> with the build system I'd like some feedback on it while I continue to make
> more changes.

I'm uneasy with so much changes in one go. Could you try to split the path
up into separate, self-contained and maeningful changes, please?

For example, avoid presentation-related changes (eg. correct indentation)
with functional changes; add the check for 'stat', libtool, libtoolize each
in their own patch; and so on...

If possible, please use Mercurial the Mercurial repository to base your
changes on, and use the Mercurial patchbomb extension to send your patches,
it's much easier to work with. Look at docs/overview.txt, section titled
"Contributing" for a quick explanations.

> 1) More effective detection of sed parameters. Checks for the correct
> format of the zero-length -i option, as well as -r vs -E for extended
> regex.

Well, GNU sed interprets '-i' as 'in-place', which means the result goes
back into the input file. OSX sed has no such option. So you have to handle
it otherwise, just dumping the '-i' is not he solution.

> 2) More effective detection of libtool / libtoolize. Looks for glibtool
> / glibtoolize if the first check fails.

You have to save the result in the paths.mk, and then use that in
scripts/crosstool-NG.sh to create a bin-override wrapper (at about line 76).

> 3) More effective of detection of stat. So far, just determines whether
> to pass -c or -f, but since the format strings are different, this should
> be elaborated on.

Ditto. Applies to scripts/functions and scripts/populate.in

> 4) Custom implementation of recursive readlink (i.e., `readlink -e`). This
> option is not supported on BSD, so we simulate it.

@@ -22,6 +22,14 @@
     exit 1
 }

+# Recursively run `readlink' in lieu of the -e option on BSD hosts.
+rreadlink() {
+    where="${@}"
+    until [ "${where}" = "$(readlink "${where}")" ]; do
+        where="$(readlink "${where}")"

Please use a temporary variable to avoid calling readlink twice.

+    done
+}
+
 # Given an option string and the following argument,
 # echoes the value of the option.
 # If --var=val => echoes val and returns 0, meaning second arg was not consumed
@@ -160,7 +168,7 @@
                 printf "Checking for '${item}'... "
                 where="$( gcc -print-file-name="${item}" )"
                 if [ "${where}" != "${item}" ]; then
-                    where="$( readlink -e "${where}" )"
+                    rreadlink "${where}"

Nope, please use like that:
  where="$(rreadlink "${where}")"

> I think the options detected during configuration still need to be somehow
> passed through to the build scripts, since right now they are used to
> generate the Makefile and then go out of scope.

Yep, use the bin-override directory, as mentioned above.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]