Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building c3270 in buildroot (ncursesw/ncurses.h) #98

Open
binary-sequence opened this issue Jan 9, 2025 · 3 comments
Open

Building c3270 in buildroot (ncursesw/ncurses.h) #98

binary-sequence opened this issue Jan 9, 2025 · 3 comments

Comments

@binary-sequence
Copy link

Hi Paul,

Compilation fails now on #include <ncursesw/ncurses.h>.

Buildroot doesn't offer an ncursesw path. I can config buildroot to build ncurses with wide character support, but it will then be available as #include <ncurses.h>.

I see on c3270/configure some checks to find the ncurses path, but the check fails and thinks it finds ncursesw/ncurses.h. I think because it is looking in the host instead of the target.

I am trying to understand how ac_fn_c_check_header_compile works, but maybe you now how to fix it faster.

Kind Regards

@binary-sequence
Copy link
Author

So, I think I need to let ac_fn_c_try_compile::ac_compile have the right CC and CFLAGS.

@pmattes
Copy link
Owner

pmattes commented Jan 9, 2025

Okay, now I see that you are doing cross-compilation. The x3270 build system does not directly support cross-compilation, except for building Windows executables on Linux, which is done as a set of specific Windows build targets.

You are correct, you need to provide ./configure with CC and CFLAGS that match your target system, not your host system. This is the old, hacky way of doing cross-compilation and is not guaranteed to work. The big is issue is that there are utility programs that build and run as part of the build, and if your target architecture is not compatible with your build host, then they will fail.

@pmattes
Copy link
Owner

pmattes commented Jan 12, 2025

Now I've fixed cross-compilation in 4.4. As with most autoconf-based systems, you can specify --host=xxx and x3270 will cross-compile for host type xxx -- assuming that you have the correct toolchain and libraries installed for that system type.

I'm also in the process of getting rid of the build-related tools that are compiled and run on the build host. These are being replaced with Python scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants