Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#21434 closed defect (fixed)

NcursesW will not build universal -- solution

Reported by: michael-macports@… Owned by: imajes@…
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: Cc: martijn@…, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: ncursesw

Description

Ncursesw will not build universal.

On a PPC machine, building i386, you need the following:

Nope, turns out it needs CFLAGS='-arch i386' CXXFLAGS='-arch i386'

To clarify: The old build was specifying the cross compiler flags correctly, but was NOT specifying the build arch. Hence, the cross compiler test did not come out correct, and the program does not build.

=== This might not solve the issue for building universal on x86. The build script assumes that if you can run an executable produced by the compiler, then it is not a cross compile. I know x86 can run ppc applications; I don't know if they can run ppc unix programs.

Attachments (2)

ncurses-5.7-i386-config.log (16.6 KB) - added by drechsel@… 14 years ago.
Portfile.diff (255 bytes) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 14 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 15 years ago by michael-macports@…

Here is a complete output of attempting to build from scratch.

Kleiman-ibook:~ michael$ sudo port install ncursesw +universal
Password:
--->  Computing dependencies for ncursesw
--->  Fetching ncursesw
--->  Attempting to fetch ncurses-5.7.tar.gz from http://mirrors.kernel.org/gnu/ncurses
--->  Verifying checksum(s) for ncursesw
--->  Extracting ncursesw
--->  Applying patches to ncursesw
--->  Configuring ncursesw
--->  Configuring ncursesw for architecture ppc
--->  Configuring ncursesw for architecture i386
Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_ncursesw/work/ncurses-5.7-i386" && ./configure --prefix=/opt/local --disable-dependency-tracking --disable-dependency-tracking --enable-widec --disable-rpath --with-shared --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --mandir=/opt/local/share/man --with-manpage-format=normal --disable-dependency-tracking --host=i386-apple-darwin9.8.0 --with-build-cc='/usr/bin/gcc-4.0' --with-build-cpp='/usr/bin/cpp-4.0' --with-build-cppflags=-D_XOPEN_SOURCE_EXTENDED --enable-big-core --with-chtype=long --with-bool='unsigned char' " returned error 1
Command output: checking for nawk... no
checking for awk... awk
checking for egrep... (cached) grep -E
checking for a BSD compatible install... /usr/bin/install -c
checking for tdlint... no
checking for lint... no
checking for alint... no
checking whether ln -s works... yes
checking for long file names... yes
checking if we should assume mixed-case filenames... auto
checking if filesystem supports mixed-case filenames... no
checking whether make sets ${MAKE}... yes
checking for ctags... yes
checking for makeflags variable... 
checking for i386-apple-darwin9.8.0-ranlib... no
checking for ranlib... ranlib
checking for i386-apple-darwin9.8.0-ld... no
checking for ld... ld
checking for i386-apple-darwin9.8.0-ar... no
checking for ar... ar
checking for archiver options (symbol AR_OPTS)... rv
checking if you have specified an install-prefix... 
checking for native build C compiler... /usr/bin/gcc-4.0
checking for native build C preprocessor... /usr/bin/cpp-4.0
checking for native build C flags... 
checking for native build C preprocessor-flags... -D_XOPEN_SOURCE_EXTENDED
checking for native build linker-flags... 
checking for native build linker-libraries... 
configure: error: Cross-build requires two compilers.
Use --with-build-cc to specify the native compiler.

Error: Status 1 encountered during processing.
Kleiman-ibook:~ michael$ 

comment:2 Changed 15 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to imajes@…

Please use either attachments or WikiFormatting...

comment:3 Changed 14 years ago by martijn@…

Cc: martijn@… added

Cc Me!

comment:4 Changed 14 years ago by martijn@…

Any ETA for a fix?

comment:5 Changed 14 years ago by martijn@…

Can anyone be so kind to explain where I should put this?

"Nope, turns out it needs CFLAGS='-arch i386' CXXFLAGS='-arch i386'

comment:6 Changed 14 years ago by drechsel@…

Will somebody please be so kind and give a step-for-step instruction for the CFLAGS='-arch i386' CXXFLAGS='-arch i386' thing? - I came into the same problem.

comment:7 Changed 14 years ago by ak@…

Yep, would be nice to move this forward - having the same issue here.

Maybe we should just give up the pretense that macports is universal?

comment:8 Changed 14 years ago by drechsel@…

BTW.: Sorry, I forgot: I tried to build Ncursesw as +universal variant on a PPC (G4), Mac OS X 10.4

comment:9 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

comment:10 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Marcus, maybe you have some idea? I'm afraid I don't have time to try to understand everything your universal changes from r47312 are doing.

comment:11 in reply to:  10 ; Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to ryandesign@…:

Marcus, maybe you have some idea? I'm afraid I don't have time to try to understand everything your universal changes from r47312 are doing.

I am at a bit of a loss.
Universal ncursesw (both ppc/i386 and i386/x86_64) build fine on my machine (10.6.2).

Perhaps someone could post the config.log for the failing build architecture.

comment:12 in reply to:  11 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to mcalhoun@…:

Replying to ryandesign@…:

Marcus, maybe you have some idea? I'm afraid I don't have time to try to understand everything your universal changes from r47312 are doing.

I am at a bit of a loss.
Universal ncursesw (both ppc/i386 and i386/x86_64) build fine on my machine (10.6.2).

Perhaps someone could post the config.log for the failing build architecture.

Can you build it for PPC and i386 on a 10.5.8 PPC host machine? That's where I wasn't able to build it.

Unfortunately, I do not have access to a PPC machine to test on.
I would be happy to try to get it working, but someone with a PPC machine will have to help me out.
Sending the config.log might be a good place to start.

Changed 14 years ago by drechsel@…

Attachment: ncurses-5.7-i386-config.log added

comment:13 Changed 14 years ago by drechsel@…

I attached a config.log from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_ncursesw/work/ncurses-5.7-i386/ - I hope, that is what you folks need. If not - please let me know where to look. NB.: G4 PPC, Mac OS X 10.4.11

The error message is the same as in the initial post. Yours, Wolf

comment:14 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

For cross-compiling, the configure script requires two compilers: one for the build architecture
and one for the run architecture.
It assumes that if they are they same, then there must be an error.
On MacPorts, -arch is set in CFLAGS, so the compilers are the same.

I think that the attached patch will fix the problem.
Would someone mind confirming this?

Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile.diff added

comment:15 Changed 14 years ago by drechsel@…

Works for me - G4, 10.4.11. Thanks!!

comment:16 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: newclosed

Fixed in r64168.

comment:17 Changed 14 years ago by martijn@…

Nice. When can we expect this fix in the repos? Just update?

comment:18 in reply to:  17 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to martijn@…:

Nice. When can we expect this fix in the repos? Just update?

Yes, the fix is already in the repository.

comment:19 Changed 14 years ago by martijn@…

Confirmed. Gtk still fails to build though. I created a new ticket: #23851

Note: See TracTickets for help on using tickets.