compiling Vim 7.4 under AIX 6.1 - c

I have a problem while compiling Vim 7.4 under AIX 6.1.
My options for the configure script are: "--prefix /opt/freeware/bin" and "--enable-pythoninterp".
There where no Errors while running the configure Script but when I try to run "make" I get the error message:
cd src && make first
cc -qlanglvl=extc89 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA -DFUNCPROTO=15 -g -o objects/regexp.o regexp.c "regexp_nfa.c"
line 4410.1: 1506-046 (S) Syntax error.
make: 1254-004 > The error code from the last command is
1.
Stop. make: 1254-004 The error code from the last command is 2.
Stop.
Does anyone know what to do?
I had compiled Vim 7.4 in my home directory so I know that there is a workaround but I can't find it anymore.

AIX's built in make (based on standard AT&T make) is not compatible with the Makefiles built by autoconf tools. Use GNU make (gmake) instead. You may already have it installed (check /opt/freeware/bin), install from the Linux Toolbox for AIX set (from IBM), or from one of the websites providing prebuilt GNU tools for AIX systems (perzl, bullfreeware, etc). Just provide an alias from make to gmake, or override the use of make in the Makefile itself.

Related

Debian linux mingw compile Windows dll including openssl library

I am on a Debian linux build environment and cannot change this. We build our apps using mingw and would like to use the openssl suite of tools in one of our applications. The linux version contains the includes openssl/md5.h and compiles gcc with the -lcrypto flag and works great.
What do I need to do to build the Windows dll using mingw and include openssl?
My build command looks like this
x86_64-w64-mingw32-gcc -shared -s FILE.c FILE.def -lcrypto -lws2_32 -o OUT.dll
This produces the error fatal error openssl/md5.h no such file or directory.
I have tried to add the -I /path/to/openssl/includes
Then get the ld error cannot find -lcrypto. I have the libssl-dev libraries.
I have the source for openssl and have tried to compile it using mingw as some other articles have suggested. "cannot find -lcrypto -lssl" with OpenSSL on Windows with MinGW
But the build always fails with multiple files missing the include bits/libc-header-start.h. My thinking was if I can get the windows dlls on the linux system maybe that was what mingw needed.
I have tried to install gcc-multilib as suggested in this post "fatal error: bits/libc-header-start.h: No such file or directory" while compiling HTK but that leads to a basket of missing dependencies.
Is it even possible to build a Windows dll including openssl dependencies from a Debian dev environment?
Thanks for any assistance.

GCC as m68k cross-compiler

I am trying to recompile binutils and GCC as a cross-compiler for m68k architecture. I am following these instructions:
http://darkdust.net/writings/megadrive/crosscompiler
However, the process keeps failing on one part or another. I have tried with binutils 2.16.1 and gcc 3.4.6, binutils 2.15 and gcc 3.4.2 and binutils 2.15 and gcc 3.4.6.
This last attempt fails when running "make" on gcc, after making and installing binutils. It gives the following error:
gcc -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-
prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H
-I. -I. -I../../gcc-3.4.2/gcc -I../../gcc-3.4.2/gcc/. -I../../gcc-
3.4.2/gcc/../include \
-DTARGET_MACHINE=\"m68k-coff\" \
-c ../../gcc-3.4.2/gcc/collect2.c -o collect2.o
In file included from /usr/include/fcntl.h:289:0,
from ../../gcc-3.4.2/gcc/system.h:214,
from ../../gcc-3.4.2/gcc/collect2.c:30:
In function ‘open’,
inlined from ‘collect_execute’ at ../../gcc-3.4.2/gcc/collect2.c:1535:20:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to
‘__open_missing_mode’ declared with attribute error: open with O_CREAT or
O_TMPFILE in second argument needs 3 arguments
__open_missing_mode ();
^
Makefile:1364: recipe for target 'collect2.o' failed
make[1]: *** [collect2.o] Error 1
make[1]: Leaving directory '/home/gabriel/src/gcc-build/gcc'
Makefile:23339: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2
I don't expect to fix this error, but does anyone know of a combination of binutils and gcc release that work? Should I be using a certain version of gcc to recompile gcc successfuly?
Thanks for any insight you may have on this!
EDIT:
My linux has GCC 5.4.0 so I just downloaded the 5.4.0 source to try and rebuild that for m68k cross-compiling. I now get the following error when running "make" on the gcc source:
*** Configuration m68k-unkown-coff not supported
What could be the cause of this? Is it because I need an older version of GCC? (the binutils version i'm using definately supports the m68k target). The tutorial I'm using always defines "--target=m68k-coff", should that instead be "--target=m68k-unkown-coff"?
EDIT 2:
So I tried compiling for m68k-elf but now I get this error:
checking for m68k-elf-gcc... /home/gabriel/src/gcc-build/./gcc/xgcc -B/home/gabriel/src/gcc-build/./gcc/ -B/opt/m68k/m68k-elf/bin/ -B/opt/m68k/m68k-elf/lib/ -isystem /opt/m68k/m68k-elf/include -isystem /opt/m68k/m68k-elf/sys-include
checking for suffix of object files... configure: error: in `/home/gabriel/src/gcc-build/m68k-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
I ran download_prerequisites before building so it should not be a problem with the MPC library. Any idea how to move on? I need assembler only so I don't mind what the format of the object files is. Thanks!
I used to do pretty much what you are doing right now.
My advice is to use crosstool-ng (http://crosstool-ng.github.io), as it does pretty much everything in an automated manner.
If you are studying m68k assembly, I used to host a modified version of gcc-explorer by Matt Godbolt (https://godbolt.org/). You can find a runnable docker image here (https://hub.docker.com/r/esantoro/acso-explorer/) and some more details here (https://znpy.wordpress.com/2017/05/08/decommisioning-acso-explorer-santoro-tk/)
Hope it helps,
znpy
you can build most versions with a current Linux. To install the prerequisites have a look at https://github.com/bebbo/amiga-gcc
unpack the gcc archive, e.g. to /opt/cross/gcc-6.5.0
create a separate build folder, e.g. /opt/cross/xcc-6.5.0 - never build inside gcc's source folder!
create the prefix folder, that's where binaries are installed to, e.g. /opt/cross/gcc65
ensure that these folders exist and are writable, then
configure from within that build folder using an absolute path for configure
cd /opt/cross/xcc-6.5.0/
/opt/cross/gcc-6.5.0/configure --target=m68k-elf --program-prefix=m68k-elf- --enable-languages=c,c++ --prefix=/opt/cross/gcc65 --disable-libssp --disable-nls --disable-multilib
make all-gcc
make install-gcc
I'm also running the compiler explorer for 68k gccs at https://franke.ms/cex/

Cygwin Shell: $ make ex1 returns: "The system cannot find the specified file" on Windows 7

I'm following the steps of the online book: "Learn C The Hard Way", and since I'm using Windows 7, I've installed Cygwin to use the Linux commands. But I'm facing a problem just on the first exercise of the book. I'm supposed to put the following command on the shell:
$ make ex1
After creating a ex1.c file on the folder. The command should give me:
cc ex1.c -o ex1
But instead, I'm getting the following message:
$ make ex1
cc ex1.c -o ex1
process_begin: CreateProcess(NULL, cc ex1.c -o ex1, ...) failed.
make (e=2): The system cannot find the specified file.
make: *** [ex1] Error 2
What's wrong?
First of all you should know that you should be running the command in the same directory where the file is. In cygwin, first you will have to locate to the folder in which the file is present, then you can run these make commands. Better since you are using Windows. You should better use any other windows based client for C. But if I were at your place. I would have installed a virtual Linux environment on my local windows computer and would have worked on that. You should try that once. Linux Terminal gives a lot of power to the developer. There are a lot of things which you can do on a terminal which is not supported by cygwin. For compiling C programs on Cygwin, I believe you should check if it supports compiler commands or not. :)
Make is reporting that it can not find cc.
cc is a link to gcc, and it belongs to gcc-core.
$ cygcheck -f /usr/bin/cc
gcc-core-5.4.0-1
To verify if the package is correctly installed
$ cygcheck -c gcc-core
Cygwin Package Information
Package Version Status
gcc-core 5.4.0-1 OK
If, as likely, the package is missing, you need to install it with the cygwin setup.

C Hello world: Code Blocks IDE, MinGW C compiler on windows

I can't get Code Blocks IDE to compile the hello world C program it creates when you create a new C project. I've installed MinGW and it was recognised by the IDE. But when I try to build I get the following output:
-------------- Build: Debug in TestC3 (compiler: GNU GCC Compiler)---------------
mingw32-gcc.exe -Wall -g -c
C:\Users\jody\codeblocks\testc3\TestC3\main.c -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\TestC3.exe obj\Debug\main.o Execution
of 'mingw32-g++.exe -o bin\Debug\TestC3.exe obj\Debug\main.o' in
'C:\Users\jody\codeblocks\testc3\TestC3' failed.
Why is it trying to run mingw32-g++.exe as well as mingw32-gcc.exe? (And if it shouldn't be doing this, how can I configure it not to?)
The mingw32-gcc.exe step is the compile step. The mingw32-g++.exe is the link step. This
is the correct sequence and will work if your mingw32 installation is "normal" and correct - where "normal" means
you have installed the C++ as well as the C tools.
The link step is failing for you because mingw32-g++.exe cannot be executed, most likely because
it does not exist on your PATH. Try running mingw32-g++.exe at the command prompt to check.
Look in the directory where mingw32-gcc.exe resides to see if mingw32-g++.exe is also there.
If your mingw32 installation has got broken somehow I suggest you uninstall and reinstall.
If you have intentionally installed only the C tools then that will explain what you are
seeing, and it is easily fixed:
Both mingw32-gcc.exe and mingw32-g++.exe are just tool driver programs. When invoked
with compilation options for .c files, mingw32-gcc.exe invokes the C compiler. When invoked
with compilation options for .cpp|cxx|... files, mingw32-g++.exe invokes the C++ compiler. If
either of them is invoked with linkage options then it invokes the linker.
Codeblocks by default configures mingw32-g++.exe to invoke the linker because it will do equally
well for C projects, C++ projects and C/C++ projects, and it assumes you have the full C/C++ toolchain.
If you have not installed C++ tools and only want to build C, then you can use mingw32-gcc.exe
to invoke both the C compiler and the linker. To configure this in the CodeBlocks IDE:
Navigate Settings -> Compiler
Ensure that the Selected Compiler is GNU GCC
Tab to Toolchain executables
Change Linker for dynamic libs from mingw32-g++.exe to mingw32-gcc.exe
OK out of Settings and rebuild your project.
Firstly uninstall the codeblocks if you can't get something right. Move to codeblocks official site to download its minw.exe version so that you have a proper compiler for all of your C programs.
After installing go to Setting>Compiler>GNU GCC compiler.
Move to Toolchain Executables>.
Now set Compilers Installation Directory. Most probably it's C:\Program Files\CodeBlocks\MinGW\bin. Now you have to select and locate your C compiler as it is in the above mentioned directory.
After that rebulid and run your program.
It may occur because compiler installation directory path is wrong.to fix it
settings -> compiler -> toolchain executables. now set compiler directory to compiler folder. it must be in CodeBlocks folder if you downloaded CodeBlocks compiler integrated version(ex: C:\Program Files\CodeBlocks\MinGW). else you need browse to location where compiler is installed
if you can't find compiler then uninstall codeblocks and download again . but this time make sure you downloaded one which has "mingw" in name for windows.

-mno-cygwin : gcc building Mercurial (Windows 2000)

Because the Mercurial Installer will not work on an old Windows 2000 system, I'm trying to build it from source. Its complaining that the C Compiler doesn't recognize the option -mno-cygwin. My version of gcc is 4.6.1. and MinGw is only two months old.
Followed these steps: https://www.mercurial-scm.org/wiki/BuildingOnWindows
F:\mercurial-2.0.2>python setup.py build
running build
running build_mo
warning: hgbuildmo: could not find msgfmt executable, no translations will be built
running build_py
package init file 'mercurial\__init__.py' not found (or not a regular file)
package init file 'mercurial\__init__.py' not found (or not a regular file)
running build_ext
building 'mercurial.base85' extension
f:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -If:\python27\include
-If:\python27\PC -c mercurial/base85.c -o build\temp.win32-2.7\Release\mercurial\base85.o
**cc1.exe: error: unrecognized command line option '-mno-cygwin'**
error: command 'gcc' failed with exit status 1
From a comment by a TDM-GCC MinGW distro developer:
As of the 4.6 series, GCC no longer accepts many unrecognized options
or flags. TDM-GCC has never "supported" -mno-cygwin; now, it will
complain about it. This is also true for libtool flags such as
"-no-undefined".
So you may have to use a somewhat older GCC version that will ignore the meaningless option, or fix the build scripts so they don't use that flag (which would never be necessary with the MinGW compiler anyway).
As a follow-on note, it looks like the Cygwin compiler stopped supporting -mno-cygwin starting with GCC 4: http://www.cygwin.com/ml/cygwin/2009-03/msg00802.html
So that option has been more or less useless for a couple years.
You not to forget this step before running "python setup.py build"?
If using mingw, a setup.cfg needs to be created which directs setuptools to use it:
cd mercurial
echo [build] > setup.cfg
echo compiler=mingw32 >> setup.cfg

Resources