Need help with configuring aclocal, autoconf, automake)

44 views
Skip to first unread message

Jibitesh

unread,
Jun 29, 2009, 8:48:56 AM6/29/09
to VGLUG
I have a small C code which will do as a apache module. The
configure.in file is
-------------------------------------------------------------------------------------------------------------------------------
#Required initializer
AC_INIT

# Automake initialization
AM_INIT_AUTOMAKE(mod_tut1, 1.0)

# Add a test for a compiler.
AC_PROG_CC
AC_PROG_LIBTOOL

# Define a macro that is used to parse a --with-apache parameter
# The macro is named "APACHE_DIR"
AC_DEFUN([APACHE_DIR],[

AC_ARG_WITH(
apache,
[ --with-apache[=DIR] Apache server directory],
,
[with_apache="no"]
)

AC_MSG_CHECKING(for Apache directory)

if test "$with_apache" = "no"; then
AC_MSG_ERROR( You need to specify the apache directory using --with-
apache)
else
# make sure that a well known include file exists
if test -e $with_apache/include/httpd.h; then
apache_dir=$with_apache
AC_MSG_RESULT(APACHE found!)
else
AC_MSG_ERROR( $with_apache not found. Check the value you
specified with --with-apache)
fi
fi

])

# Now call the APACHE_DIR macro that was just specified
APACHE_DIR

# Save the location of apache into the "apache_dir" variable.
# The AC_SUBST macro causes the variable to be saved in config.status
AC_SUBST(apache_dir)

# Write config.status and the Makefile
AC_OUTPUT(Makefile)
-------------------------------------------------------------------------------------------------------------------------------

Now when i do a automake after running aclocal and automake, it says

********************************************************************************************************************************
Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
Makefile.am:4: The usual way to define `LIBTOOL' is to add
`AC_PROG_LIBTOOL'
Makefile.am:4: to `configure.in' and run `aclocal' and `autoconf'
again.
Makefile.am:4: If `AC_PROG_LIBTOOL' is in `configure.in', make sure
Makefile.am:4: its definition is in aclocal's search path.
********************************************************************************************************************************

Now the fun part. libtool.mp4 is in /usr/share/aclocal and it has a
macro named AC_PROG_LIBTOOL.
I dunno what i am doing wrong. Any help will be appreciated.

Thanks
GB

Alok Thaker

unread,
Jun 29, 2009, 8:59:55 AM6/29/09
to VG...@googlegroups.com
Hi,

From which directory are you running ./configure & make

Thanks,
Alok !
Inferno Solutions !
Go with the best !
www.inferno.co.in !
All Linux-Java Solutions-Training under one Roof !
M:-9925519798 !

Shakthi Kannan

unread,
Jun 29, 2009, 9:00:21 AM6/29/09
to VG...@googlegroups.com
Hi,

--- On Mon, Jun 29, 2009 at 6:18 PM, Jibitesh<jibi...@gmail.com> wrote:
| I have a small C code which will do as a apache module. The
| configure.in file is

\--

Nowadays it is called 'configure.ac'?

---


| Now when i do a automake after running aclocal and automake, it says

\--

I prefer to use 'autoreconf -i'.

---


| Now the fun part. libtool.mp4 is in /usr/share/aclocal and it has a
| macro named AC_PROG_LIBTOOL.

\--

Which version of autoconf, automake and libtool are you using? Which
distro are you using? Can you provide the full tarball of the sources
for testing?

Try this Chapter (and also read the full book):
http://www.freesoftwaremagazine.com/books/agaal/building_shared_libraries_once_using_autotools

SK

--
Shakthi Kannan
http://www.shakthimaan.com

GB

unread,
Jul 1, 2009, 4:54:47 AM7/1/09
to VGLUG
I am sorry for the late reply but i finally got to make it work.
reinstaalled libtool and automake and now everything is working fine.
And i found another easier way to compile apache modules, just in case
someone wants to know.

use the perl script in apache/bin named apxs.

apxs -c <filename> compiles the file and generates the la file.
apxs -i -n -a <mod name> <file name of the .la extension file>

This installs the mod on your apache server. Check the syntax and mod
by running apachectl -t and you r ready to run.

Thanks for your help guys.

GB

GB

unread,
Jul 1, 2009, 7:43:35 AM7/1/09
to VGLUG
Had to write this.
The book is amazing. Thanks Shakthi.
Reply all
Reply to author
Forward
0 new messages