Hi,
I will be conducting an introductory workshop on GNU autotools in #fedora-classroom on 03 May, 2010 at 13:30 UTC. The aim of the classroom is to get people started on autotoolizing C code. I will use an example project and will go through the following:
* Downloading the sample application * Creating files for the application => configure.ac -> Initialization -> Checks -> Output => Makefile.am -> Build programs -> Install additional files * Generating scripts
Prerequisites for those wanting to attend this:
* Familiarity with make, gcc * Ensure that autoconf, automake, gcc, make, etc. are installed on your system. `yum groupinstall "Development Tools"` ought to get all of it
The session will not be covering autoheader and libtool since: * The sample I'm using does not need it * Those concepts are slightly more advanced and may require more time
In other words, the session is for people who have never worked with autotools before.
On Mon, Apr 26, 2010 at 11:14 AM, Siddhesh Poyarekar siddhesh.poyarekar@gmail.com wrote:
Hi,
I will be conducting an introductory workshop on GNU autotools in #fedora-classroom on 03 May, 2010 at 13:30 UTC. The aim of the classroom is to get people started on autotoolizing C code. I will use an example project and will go through the following:
Reminder: This is two hours from now.
On Mon, May 03, 2010 at 17:02:12 +0530, Siddhesh Poyarekar siddhesh.poyarekar@gmail.com wrote:
On Mon, Apr 26, 2010 at 11:14 AM, Siddhesh Poyarekar siddhesh.poyarekar@gmail.com wrote:
Hi,
I will be conducting an introductory workshop on GNU autotools in #fedora-classroom on 03 May, 2010 at 13:30 UTC. The aim of the classroom is to get people started on autotoolizing C code. I will use an example project and will go through the following:
Reminder: This is two hours from now.
I'll be travelling from home to work during the meeting time, so probably won't catch much of it live, but will read the logs after the fact. One question I have is how to handle when you need the math library and/or simple X stuff. I have been doing some DSO linking cleanup and have been recommending adding -lm or -lX11 to the prog_ADD type variable in the Makefile.am to fix these cases, but I am wondering if there is a better way to do that?
On Mon, May 03, 2010 at 08:15:20 -0500, Bruno Wolff III bruno@wolff.to wrote:
I'll be travelling from home to work during the meeting time, so probably won't catch much of it live, but will read the logs after the fact. One question I have is how to handle when you need the math library and/or simple X stuff. I have been doing some DSO linking cleanup and have been recommending adding -lm or -lX11 to the prog_ADD type variable in the Makefile.am to fix these cases, but I am wondering if there is a better way to do that?
That should have been prog_LDADD.
On Mon, May 3, 2010 at 6:48 PM, Bruno Wolff III bruno@wolff.to wrote:
On Mon, May 03, 2010 at 08:15:20 -0500, Bruno Wolff III bruno@wolff.to wrote:
I'll be travelling from home to work during the meeting time, so probably won't catch much of it live, but will read the logs after the fact. One question I have is how to handle when you need the math library and/or simple X stuff. I have been doing some DSO linking cleanup and have been recommending adding -lm or -lX11 to the prog_ADD type variable in the Makefile.am to fix these cases, but I am wondering if there is a better way to do that?
That should have been prog_LDADD.
If you want to be really generic (which is the point of autotools anyway), you can use the AC_CHECK_LIB macro to check for presence of the library in question (libm, libX11). So you will have:
AC_CHECK_LIB([m], [sin],,[AC_MSG_ERROR("No libm present")]) AC_CHECK_LIB([X11], [XOpenDisplay],,[AC_MSG_ERROR("No libX11 present")])
This does the check and adds the required flags to LDFLAGS if present. If not, it returns an error.
On Mon, May 03, 2010 at 18:55:51 +0530, Siddhesh Poyarekar siddhesh.poyarekar@gmail.com wrote:
If you want to be really generic (which is the point of autotools anyway), you can use the AC_CHECK_LIB macro to check for presence of the library in question (libm, libX11). So you will have:
That's kind of where I was going with this. Though in many cases it makes more sense to do a simple Makefile.{in,am} patch rather than rerunning autotools and carrying a much larger patch. But for upstreaming, that does seem like a better solution.
AC_CHECK_LIB([m], [sin],,[AC_MSG_ERROR("No libm present")]) AC_CHECK_LIB([X11], [XOpenDisplay],,[AC_MSG_ERROR("No libX11 present")])
This does the check and adds the required flags to LDFLAGS if present. If not, it returns an error.
Thanks. I was suppecting there was something like this.
classroom@lists.fedoraproject.org