Alternatives to Autoconf and Autotools? [closed] - c

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm a very frequent user of the GNU Autotools (mostly Autoconf, occasionally Libtool). I'm working on a project where portability is going to be a sticking point.. Yet, the rest of the team is just not comfortable working with m4. I got this in my inbox from not one, but four people:
Anyway, perhaps someone could recommend something Python or PHP based? I'm working on the C end of a much larger tree; I can be sure either Python or PHP 5 will be present, as they are prerequisites.

I'm taking the chance of being downvoted but, I must admit, that unfortunately there is no real substitute for autotools. CMake, SCons, bjam are nice but, when it comes to serious work... it is quite clear that autotools are superior, not because CMake can't do the same thing, but because it is just much harder to do so with it.
For example, CMake, the most popular alternative to autotools, has the following drawbacks:
No support of gettext. This may be a real problem when you need to manage a lot of translations and translated source code.
No support for an uninstall target. It is quite unpleasant to find out that you can't uninstall the program you installed.
No automatic build of both shared and static libraries.
Documentation is very limited and bad.
And so on.
There are many other points. Unfortunately, there is no real high quality substitute for autotools. On the other hand, if you develop on Windows and for Visual Studio, then you can't use autotools and you need to choose CMake that provides such tools.

I have heard good things about CMake which tries to solve the same problems. Here is the wikipedia article

I've had good success with SCons. It's built with Python and the build scripts are actually Python scripts themselves, which gives a great deal of expressive power. From the web site:
SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software.

There are a lot of different alternative Makefile generators and build systems out there:
CMake
Scons
Waf
Boost Build (aka BJam, C++)
Also available, but not stringently targeted on C/C++:
Premake
Ant (for Java)
Rake (for Ruby)
(Definitely more, I just don't know them all...)
But after listing these all, autotools have the great advantage of not requiring any other dependency for the end-user. A configure script is only generated once by the developer and does not require anything special on the user end, as it is a shell script. The tools listed above have to be installed before anyone can build your source and they even might have dependencies themselves.

How about simply using Make and pkg-config?
Here is a Makefile template to get you started.
Less is more people.

One more auto* replacement - mk-configure. Docs can be found here

I have had a look at CMake, which looks like a good alternative unless you are cross-compiling. If you are doing native compilation, you should try it

There's a python version of make being created at Mozilla - pymake - which presumably supports cross-platform use.

For building C/C++ software from ANT or maven you might be interested in terp. It includes a portable C++ compiler task that works with many C++ compilers on many platforms.

Related

What programming languages, without a runtime, besides C, are good for writing programming languages? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking into a hobby of writing a toy programming language, partly from minor annoyances with other languages, partly so that I can understand what it's like, but mostly just to fool around.
On the off chance that it gets really useful, I don't want it to depend on the run-time of another programming language for programs written in it to run. That is, I want the interpreter / compiler to itself be a program compiled natively into the target OS (language itself may be interpreted / provide a run-time).
Is there any alternative to doing this besides C? What are some advantages / disadvantages or using each?
Clarification 1: I am not intending to go low-level enough to write kernels, filesystems, device drivers, boot loaders. However I would like to be able to manage my own memory.
Clarification 2: Due to a terminology error / misunderstanding, and since I was so used to the C runtime running on various OS's, I said that C does not have a runtime / and or I am not interested in a runtime. A better way to say what I really want is that my programs compile natively into the target (desktop) OS without needing to install additional software from the bootstrapping language.
2.1: if I write the compiler/interpreter in python, I don't want the emitted executables to depend on the python program.
2.2: if I use a compiling step, for instance, to compile the programs using perl, I don't want the emitted executables to depend on a libperl.dll/so.
2.3: the exception is with runtimes is C since the C runtime is usually installed on almost all desktop OS's as many core OS tools depend on it.
You could use any language that has an existing compiler that emits native code without dependencies. C and C++ are pretty good bets because their runtimes are available pretty much everywhere (even more so in C).
One approach in your language build-up that could be well worth trying is this: make your compiler output C (or C++). Then you can use all the existing ecosystem around those languages and their runtimes (linkers, object dumpers, debuggers, etc...), even plan integration with existing code.
Those tools would be useful both for the users of your language, and obviously for yourself while you're experimenting on that toy language.
Once you get to the point where your language is "self-hosted" (i.e. your compiler is written in your own language), you'll be able to start thinking about doing away with the whole C part and write a native code compiler, with its runtime.
Good luck :-)
Also make sure you go look at LLVM. It's a "compiler infrastructure". That is probably the best place to start with these days to implement a new language. The documentation is pretty good, and the tutorials include building a toy language.
C has a runtime... C++ has a slightly bigger minimal run-time than C. Some implementations of Ada have pragmas allowing to check that some features mandating the use of a run-time aren't used (I wonder if they weren't standardized later, I've stopped to follow Ada standardization in the late 90's), making it perhaps having a minimal run-time of the same compexity as C.
PyPy usses RPython to implement python language. Will this work for you?
Haxe is written in OCaml, and I think this is a really good language for writing other languages.
http://haxe.org/
http://caml.inria.fr/
If your going to write bootloaders and kernels then C is your language, otherwise it doesn't matter what language you use to develop your language. Just because your host language has a runtime doesn't automatically mean your target language must have one.
But ofcourse toy languages need a runtime, for example a JVM/LLVM/.NET CLR. Or interpreters. If you don't go for these choices you need to generate machine code that conforms to a ABI, and that is very painfull.
I suggest you look target llvm and generate machine code from there, dalvik might also fit your needs (since it is extremely lightweight).
I think Python is best for you. Python is a programming language that you can work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.
Python, recently, has been ported to the Java and .NET virtual machines.
The most important, Python is free.

Why there is not a comprehensive c archive network? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
There are websites as collections of python/perl/R libraries. Why there is not an equivalent one for c?
I searched the internet and only found a small website calling itself CCAN. There are only a few libraries in that website.
If I need extra libraries for c programming, where can I find them? Is there an well organized website of the c libraries?
Thanks.
If I need extra libraries for c programming, where can I find them? Is there an well organized website of the c libraries?
No known to me outside of CCAN.
The problem here is that C doesn't have any even loose specification for libraries. Compare that to e.g. packages in Java or Python or Perl.
And even then, C is quite bare bone itself leaving many things for libraries to implement themselves. I/O abstraction, memory management, multi-threading, OS integration - minor differences in how libraries work with any of the resources might make them incompatible, preventing them being used in the same project.
I have seen in past some 3rd party commercial libraries for C, covering quite a lot of functionality, but frankly I can't recommend them and honestly do not even remember their names - for they often were causing more problems than really helping. (OK, I'm lying: they were rarely causing unsolvable problems: it's the numerous workarounds which were causing often the problems later.)
Otherwise, for C you might want to check the Glib and (do not get me wrong) to also check the C standard as in my experience few actually know many of the utilities already in the standard library itself. And well, Google is your friend: lots of public domain code is there for you to simply throw as-is into your project.
I don't know of anybody who's studied this in detail, though I would be curious to see the studies. I'm sure it has to do with the nature of the C programming community itself.
I think a large (maybe the primary?) part of the answer is: before the WWW, there was no such thing as a single resource for obtaining libraries for a particular language. People obtained their libraries, and knowledge of libraries, via many different means: through BBSes, mailing lists, newsgroups, and periodicals. The C community dates from this time, of course, and I've noticed a similar difference in culture regarding other languages from this period and before.
I think another part of the answer has to do with the general decentralization of C culture itself. There's no one C compiler, no one C development community, that serves as a hub and a potential point for projects to attach themselves to. And the C development community is huge, which further drives this decentralization and splintering.
In the case of C libraries, OS distributions actually do a pretty good job of collecting useful C/C++ libraries out there. (With the unfortunate exception of Windows, I believe.) They do a better job in these languages than most others, probably since C and C++ are such important systems languages on these platforms.
As far as CCAN goes, I think what would make a more worthwhile project, given the number of different distributors of C code out there, is to have a single site that links to the various libraries on their own native sites, rather than trying to get them to upload straight to CCAN. I think there's a use for this in and apart from Google, which will give you a lot of noise if you try just browsing for libraries. The question is, would you and the bulk of the C communities out there embrace such a site if it existed?
You might be amused to see how CPAN got its start: http://www.brainbell.com/tutors/Perl/CPAN_History.htm
CPAN evolved just as its community did. So the same thing could happen in the C/C++ world if the leadership and interest is there. But it hasn't happened yet.
use http://www.google.com/codesearch?q=lang:%22C%22 variant of http://www.google.com/codesearch
=> i.e. add lang:"C" in the search query
Use these web-sites:
Debian "Testing": Subsection libs
The Free Country: Free C/C++ Libraries
Free Software Directory: Category/Library
SourceForge Software Map: Software Development/Libraries/C
Upstream Tracker: List of C/C++ Shared Libraries
There is a Maven-like repository and dependency management system called Biicode.
There isn't a huge collection of libraries on there yet, but you can add forks of open source projects yourself or inform original authors about it.
EDIT: the company behind biicode is dead
EDIT2: the spiritual successor seems to be conan.io
There is a C package manager which looks promising called CLib:
github:
https://github.com/clibs/clib
tutorial:
https://dev.to/noah11012/clibs-a-package-manager-for-c-4jmi
Why do you need a website for a collection of C libraries? Just use Google.

What are the IDEs available for gtk+ development [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Recently i start to studying C/gtk+ programming. And want to ask one question: what are the IDEs available for C/gtk+ development apart from command line interface?
Thank you.
In my (biased) opinion and experience, you're better off learning GTK by command-line compilation and your favorite editor (gedit, kate, vi, emacs, whatever). This way, you can learn at your own pace rather than trying to grapple with a big complicated IDE that really isn't beginner-friendly. Nonetheless, be aware of devhelp (GTK's development documentation program) and try building a couple GUIs with glade3 and using them in your C programs.
This might not be the answer you want, but I feel that C/C++ GUI IDEs tend to suck, at least for beginners.
Anjuta can do C/GTK+, but I personally wasn't very impressed with it. It asks you what plugin you want to open .glade files with, new projects are built with autoconf (resulting in a mess of over 70 files for a simple "Hello world") and localized with gettext by default (resulting in a bunch of boilerplate code in main.c), and it pops dialogs like this when you invoke weird edge cases such as double clicking a button you just created:
My impression of Anjuta from the perspective of a beginner was, as you can tell, highly negative. It shows a whole lot of advanced options, but doesn't let you do basic tasks without a lot of hassle. Anjuta is not alone. In general, I don't believe I've ever found a (mature) C/C++ IDE for any GUI toolkit that was easy for a beginner like me.
There's really nothing all that special about GTK+, it's a pretty standard C API and so any IDE that lets you program C is going to work well for GTK+. Examples include Eclipse and Code::Blocks.
You can also use Glade as RAD tool for developing GTK+ GUIs in a graphical way. Use of Glade is pretty much IDE-independent, though.
Personally I find that Eclipse CDT and Glade make a pretty good combination. Eclipse doesn't need you to use Autotools, etc. If you're under Debian/Ubuntu, I'd recommend manually installing Eclipse instead of using the repository version.
Eclipse or Anjuta IDE. I found Anjuta IDE comfortable.
NetBeans has a pretty good C/C++ suport and if you want a designer I'd second Glade. I personally prefer Emacs + Semantic + ECB for C development.

What is the best IDE for C Development / Why use Emacs over an IDE? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
so as per one of my previous questions, I'm brushing up on my C skills.
My question is, what do people use for developing C?
Lots of people use Emacs, and have done so for years, but is it better to learn emacs than just use an IDE such as Geany or KDevelop?
Would also be interested to hear from those still using emacs, and why they use it over other apps?
Please note that I'm only really interested in the free IDEs / editors.
EDIT:
Thanks for posting links which answer some of my questions, but I guess what I'm really wondering about is:
Whether learning to edit using emacs / vim and compiling / debugging using the gcc-toolchain is worth it instead of just using an IDE, and why?
What are peoples reasons for not migrating to an IDE?
Has anyone moved from terminal-centric development to IDE development, and why did they move?
I started off by using IDEs, Microsoft or not. Then, while working on QNX some long time ago, I was forced to do with a text editor + compiler/linker. Now I prefer this simple combination––a syntax highlighting editor + C compiler and linker cli + make––to any IDEs, even if environment allows for them.
The reasons are, for me:
it's everywhere. If you program in C, you do have the compiler, and usually you can get yourself an editor. The first thing I do––I get myself nedit on Linux or Notepad++ on Windows. I would go with vi, but GUI editors provide for a better fonts, and that is important when you look at code all day
you can program remotely, via ssh, when you need to. And it does help a lot sometimes to be able to ssh into the target and do some quick things there
it keeps me close to CLI, preferably UNIX/Linux CLI. So all the commands are on my fingertips, and when I need them I don't have to go read a reference book. And UNIX CLI can do things IDEs often can't––because their developers didn't think you'd need them
most importantly, it is very much like seeing the Matrix in raw code. I operate files, so I'm forced to keep them manageable. I'm finding things in my code manually, which makes me keep it simple and organized. I do Config Management explicitly, so I know when I'm synced and how. I know my Makefiles because I write them, and they only do what I tell them to
(if you wonder if that works in "really big projects"––it does work, and the bigger the project the more performance it gains me)
when people ask me to look at their code, I don't have to learn the IDE they use
I've moved from a terminal text-editor+make environment to Eclipse for most of my projects. Spanning from C and C++, to Java and Python to name few languages I am currently working with.
The reason was simply productivity. I could not afford spending time and effort on keeping all projects "in my head" as other things got more important.
There are benefits of using the "hardcore" approach (terminal) - such as that you have a much thinner layer between yourself and the code which allows you to be a bit more productive when you're all "inside" the project and everything is on the top of your head. But I don't think it is possible to defend that way of working just for it's own sake when your mind is needed elsewhere.
Usually when you work with command line tools you will frequently have to solve a lot of boilerplate problems that will keep you from being productive. You will need to know the tools in detail to fully leverage their potentials. Also maintaining a project will take a lot more effort. Refactoring will lead to updates in make-files, etc.
To summarize: If you only work on one or two projects, preferably full-time without too much distractions, "terminal based coding" can be more productive than a full blown IDE. However, if you need to spend your thinking energy on something more important an IDE is definitely the way to go in order to keep productivity.
Make your choice accordingly.
Emacs is an IDE.
edit: OK, I'll elaborate. What is an IDE?
As a starting point, let's expand the acronym: Integrated Development Environment. To analyze this, I start from the end.
An environment is, generally speaking, the part of the world that surrounds the point of view. In this case, it is what we see on our monitor (perhaps hear from our speakers) and manipulate through our keyboard (and perhaps a mouse).
Development is what we want to do in this environment, its purpose, if you want. We use the environment to develop software. This defines what subparts we need: an editor, an interface to the REPL, resp. the compiler, an interface to the debugger, and access to online documentation (this list may not be exhaustive).
Integrated means that all parts of the environment are somehow under a uniform surface. In an IDE, we can access and use the different subparts with a minimum of switching; we don't have to leave our defined environment. This integration lets the different subparts interact better. For example, the editor can know about what language we write in, and give us symbol autocompletion, jump-to-definition, auto-indentation, syntax highlighting, etc.. It can get information from the compiler, automatically jump to errors, and highlight them. In most, if not all IDEs, the editor is naturally at the heart of the development process.
Emacs does all this, it does it with a wide range of languages and tasks, and it does it with excellence, since it is seamlessly expandable by the user wherever he misses anything.
Counterexample: you could develop using something like Notepad, access documentation through Firefox and XPdf, and steer the compiler and debugger from a shell. This would be a Development Environment, but it would not be integrated.
I have used Eclipse with the CDT plug in quite successfully.
Emacs would be better if it had a text editor in it... :-)
Use Code::Blocks. It has everything you need and a very clean GUI.
Netbeans has great C and C++ support. Some people complain that it's bloated and slow, but I've been using it almost exclusively for personal projects and love it. The code assistance feature is one of the best I've seen.
How come nobody mentions Bloodshed Devc++? Havent used it in a while, but i learnt c/c++ on it. very similar to MS Visual c++.
If you are looking for a free, nice looking, cross-platform editor, try Komodo Edit. It is not as powerful as Komodo IDE, however that isn't free. See feature chart.
Another free, extensible editor is jEdit. Crossplatform as it is 100% pure Java. Not the fastest IDE on earth, but for Java actually very fast, very flexible, not that nice looking though.
Both have very sophisticated code folding, syntax highlighting (for all languages you can think of!) and are very flexible regarding configuring it for you personal needs. jEdit is BTW very easy to extend to add whatever feature you may need there (it has an ultra simple scripting language, that looks like Java, but is actually "scripted").
If you're on Windows then it's a total no-brainer: Get Visual C++ Express.

Any Online compiler you know for C or other languages? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Any online C compiler that you know which can do the following:
Compile and execute the C programs online
File handling
System functions like exec(), system(), fork()
Or any compiler which does not need installation procedure (I mean that you can just copy paste a folder to run the compiler easily)
Note:Please do not propose Turbo C.I know some online compilers at codepad.org (gcc).
I was using codeide.com but its out of service now I think.
And as asked above online compiler will be a best advice that you can give for me.
My environment is Windows ... Thanks in advance.
Any advices on other Language compilers are also invited
Just install something like tcc. It's seriously not worth messing around with an online compiling site if you're going to be compiling files on any sort of regular basis.
Comeau has an online C/C++ compiler, but it's mainly to evaluate their compiler.
or cygwin
I'd rather recommend to install cygwin, you'll get an unix-like environment, with gcc. Then setting up a Makefile - or even just a shell script - to be able to compile is not a big deal.
You asked for other languages: Here's one for Lisp (not a compiler, but an interpreter)
Online Lisp interpreter in Flash
rextester
Maybe my answer is a bit late, but we have created an online compiler and IDE where you can run and create your files using just a browser.
At the moment we support a few languages (C, C++, ObjC, Java, Pascal, Fortran) and a simple file system, but we will enable many more features for better coding and debugging during the near future.
All the features offered at the moment are completely free and there is no registration needed (you can register though in order to keep your files online).
You can try our service here: www.sourcelair.com
DJGPP Public Access Cross-Compiler (C/C++, DOS32, based on GCC)
yet another online compiler:
http://cmpe150-1.cmpe.boun.edu.tr
It supports sytax highlight, indentation etc. I wrote it as a part of my MS thesis
PS: did not test fork command
We have another compiler for C and C++ here: http://www.codepad.org/
I have nothing for C. For other languages, this is a ruby interpreter. But honestly the best online development environment is the browser itself. Javascript is an advanced language. Combined with technologies like CSS and DHTML and frameworks like jQuery or Prototype you can build graphics applications. It is not hard to find debuggers (like Firebug) also.
Of course you can't interact with the file system. To overcome this you could write a plug-in for a browser (notably Firefox). There are many resources available for this and although it is not as straight forward as pure javascript, it is easier than most people believe.
For Python and Sage, try out http://live.codenode.org. It is also open source under the BSD license, so you can be download and run it from your own computer, more info is here: http://codenode.org
just a sudgestion.
I do not know why you do not want simply to install a compiler. However did you considered the possibility of using a portable one?
http://en.wikipedia.org/wiki/Portable_C_Compiler
best,
Ste
One of the better lists for C++ is isocpp Getting Started page. Unfortunately Cameau's seems to be disabled for now. LiveWorkspace has been in maintenance mode for a while and it is not clear when it is coming back, which is unfortunate since it has a simple interface and when it was working allowed you to switch between gcc, clang and intel very easily.
Of the ones that are left Coliru is the most powerful, you have a full command line available and you can save files and therefore uses multiple files in your project.
The isocpp list somehow is missing codepad which although rather primitive along with Coliru allows you to use boost.
Coliru, ideone and codepad all support many other languages as well. The list of languages supported by ideone and codepad is pretty large and is obvious on the main pages with Coliru you don't have a list but besides C and C++ it also supports python, perl and ruby.

Resources