wmcbrine / PDCurses

A curses library for environments that don't fit the termcap/terminfo model.
https://pdcurses.org/
1.04k stars 174 forks source link

Cross build on FreeBSD using llvm-mingw #103

Closed RussellHaley closed 4 years ago

RussellHaley commented 4 years ago

Hello,

I'd like to cross build pdcurses for use in lldb-mi.exe. I am building on FreeBSD 12.1 using the rather spiffy llvm-mingw compiler. It's largely compatible with mingw-64 proper, in fact, the default Makefile compiles but doesn't link due to a missing o2dll script. I looked at porting o2dll, but decided to just re-run configure. I'm fine with either solution.

Which brings me to this issue. I have been unable to get the configure system to recognize my cross compiler. It always takes the system compiler. I've set my PATH as well as even germandered the CC variable, but configure grabs /usr/bin/cc (!). I am wondering if you have a suggestion?

The host cross compiler is at /storage/build/llvm-mingw-host/bin. I wanted to use the i686-w64-mingw32 and x86_64-w64-mingw32 toolchains

russellh@jailbird /s/s/p/s/p/2/PDCurses-2.6-src> echo $PATH
/storage/build/llvm-mingw-host/bin /sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /home/russellh/bin
russellh@jailbird /s/s/p/s/p/2/PDCurses-2.6-src> i686-w64-mingw32-gcc
clang: error: no input files
russellh@jailbird /s/s/p/s/p/2/PDCurses-2.6-src> ./configure CC=i686-w64-mingw32-gcc --target=i686-w64-mingw32
configure: warning: CC=i686-w64-mingw32-gcc: invalid host type
creating cache ./config.cache
checking for one of the following C compilers: gcc acc cc c89... using /usr/bin/cc
checking for gcc... (cached) cc
checking whether the C compiler (cc  ) works... yes
checking whether the C compiler (cc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether cc accepts -g... yes
checking for POSIXized ISC... no
checking host system type... Invalid configuration `CC=i686-w64-mingw32-gcc': machine `CC=i686-w64-mingw32' not recognized

checking target system type... i686-w64-mingw32
checking build system type... Invalid configuration `CC=i686-w64-mingw32-gcc': machine `CC=i686-w64-mingw32' not recognized

checking for maximum signal specifier:... NSIG
checking for main in -ldld... no
checking for main in -ldl... yes
checking for ranlib... ranlib
checking for a BSD compatible install... /usr/bin/install -c
checking whether make sets ${MAKE}... yes
checking how to run the C preprocessor... cc -E
checking for System V IPC support... checking for sys/ipc.h... yes
checking for ANSI C header files... yes
checking for fcntl.h... yes
checking for limits.h... yes
checking for time.h... yes
checking for sys/time.h... yes
checking for memory.h... yes
checking for string.h... yes
checking for stdarg.h... yes
checking for sys/select.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for dl.h... no
checking for errno.h... yes
checking if compiler supports ANSI prototypes... yes
checking for working const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for main in -lsocket... no
checking for main in -lnls... no
checking whether cc understand -c and -o together... yes
checking whether cc needs -traditional... no
checking for 8-bit clean memcmp... yes
checking return type of signal handlers... void
checking for vprintf... yes
checking for select... yes
checking for memmove... yes
checking for vsscanf... yes
checking for usleep... yes
checking for poll... yes
checking for location of X headers... found in /usr/local/include/X11 /usr/local/include/X11
checking for location of X libraries...  found in /usr/local/lib
checking for DECkeysym.h... yes
checking for Sunkeysym.h... yes
checking for XK_KP_Delete in keysym.h... yes
checking for XK_KP_Insert in keysym.h... yes
checking for XK_KP_End in keysym.h... yes
checking for XK_KP_Down in keysym.h... yes
checking for XK_KP_Next in keysym.h... yes
checking for XK_KP_Left in keysym.h... yes
checking for XK_KP_Right in keysym.h... yes
checking for XK_KP_Home in keysym.h... yes
checking for XK_KP_Up in keysym.h... yes
checking for XK_KP_Prior in keysym.h... yes
checking for XK_KP_Begin in keysym.h... yes
checking if XPointer is typedefed:... yes
checking shared library/external function extensions... .so/.so
checking compiler flags for a dynamic object... -fPIC
updating cache ./config.cache
creating ./config.status
creating Makefile
creating pdcurses/Makefile
creating demos/Makefile
creating panel/Makefile
creating tools/Makefile
creating saa/Makefile
creating xcurses-config
creating config.h
config.h is unchanged

I've tried various combinations with no success. Do you have any suggestion how to set this up? Any input is greatly appreciated!

wmcbrine commented 4 years ago
  1. Not that it will necessarily solve your problem, but 2.6 is just slightly out of date.
  2. You're attempting to build the X11 version. For MS Windows? Is that what you want? If not, consider the "win32" (later, "wincon") port.
RussellHaley commented 4 years ago

Ah, thank you. I cloned the repo, added the triplets to the Makefile in wincon/ and it built without issue. The code I had was from source forge. Thanks William!