[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autoconf
From: |
Ruben |
Subject: |
Re: autoconf |
Date: |
Thu, 02 Oct 2008 13:57:01 -0400 |
User-agent: |
Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) |
On Thu, 02 Oct 2008 15:25:54 +0900, Miles Bader wrote:
> "Alfred M. Szmidt" <ams@gnu.org> writes:
>> As for autoconf being impossible, many thousands of projects use it,
>> so it cannot be that hard (and it isn't).
>
> I think autoconf's reputation is not entirely deserved; it's actually
> pretty easy to use for simple everyday configuration, especially if you
> know how to write a shell script (and automake is even easier -- a
> Makefile.am file for a simple app is a thing of beauty). It's when
> things break, or when you need to do something exotic, that it can get
> kinda painful...
>
> -Miles
Well I'm strugglingwith it and the gtk mailing lists seem to have went
down this morning
I'm really a novice at autoconf and automake and trying to learn some
gtkmm but I'm running into a problem that I just don't have the
familiarity to solve and I'd like to request some help
I've done a google search for a solution and came up blank so I hope
someone can help me here.
I'm working from documentation here
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/sec-headers-and-linking.html
http://www.openismus.com/documents/linux/automake/automake.shtml#ExampleFiles
http://www.elitecoders.de/mags/cscene/CS2/CS2-10.html
http://www.openismus.com/documents/linux/automake/automake.shtml
and of course the GNU manual and http://sources.redhat.com/autobook/
I need to include the include and library flags into autoconf and
automake and it seems to fail to pickup the gtkmm and gtk library
I'm using this autogen.sh script
---------------------------------------------
#! /bin/sh
# $Id: autogen.sh,v 1.4 2002/12/02 01:39:49 murrayc Exp $
#
# Copyright (c) 2002 Daniel Elstner <daniel.elstner@gmx.net>
#
# This program is free software; you can redistribute it and/or modify
dir=`echo "$0" | sed 's,[^/]*$,,'`
echo $dir
test "x${dir}" = "x" && dir='.'
if test "x`cd "${dir}" 2>/dev/null && pwd`" != "x`pwd`"
then
echo "This script must be executed directly from the source
directory."
exit 1
fi
rm -f config.cache acconfig.h
echo "- libtoolize." && \
libtoolize --force && \
echo "- aclocal." && \
aclocal && \
echo "- autoconf." && \
autoconf && \
echo "- autoheader." && \
autoheader && \
echo "- automake." && \
automake --add-missing --gnu && \
echo && \
./configure "$@" && exit 0
exit 1
--------------------------------------------
This is my top level configure.ac
____________________________________________
AC_INIT(src/one_window.cc)
AM_INIT_AUTOMAKE(one_window,0.1)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LIBTOOL
PKG_CHECK_MODULES([MYAPP], [gtkmm-2.4 >= 2.4.0])
AC_OUTPUT(Makefile src/Makefile)
----------------------------------------------
This is my toplevel Makefile.am
------------------------------------------------
SUBDIRS = src
EXTRA_DIST=autogen.sh
________________________________________________
This is my src directory Makefile.am
_______________________________________________
bin_PROGRAMS = onewindow
onewindow_SOURCES = one_window.cc
______________________________________________
and the C++ code is very simple
one_window.cc
_____________________________________________
#include <gtkmm.h>
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
return 0;
}
_____________________________________
Everything seems to work except for the make command
ruben@www2:~/cplus/pharm/gmm> make
make all-recursive
make[1]: Entering directory `/home/ruben/cplus/pharm/gmm'
Making all in src
make[2]: Entering directory `/home/ruben/cplus/pharm/gmm/src'
cd .. && /bin/sh /home/ruben/cplus/pharm/gmm/missing --run automake-1.9
--gnu
src/Makefile
cd .. && /bin/sh ./config.status src/Makefile depfiles
config.status: creating src/Makefile
config.status: executing depfiles commands
make[2]: Leaving directory `/home/ruben/cplus/pharm/gmm/src'
make[2]: Entering directory `/home/ruben/cplus/pharm/gmm/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT one_window.o -MD -MP
-MF ".de
ps/one_window.Tpo" -c -o one_window.o one_window.cc; \
then mv -f ".deps/one_window.Tpo" ".deps/one_window.Po"; else rm -f
".deps/one_w
indow.Tpo"; exit 1; fi
one_window.cc:1:19: gtkmm.h: No such file or directory
one_window.cc: In function `int main(int, char**)':
one_window.cc:5: error: `Gtk' undeclared (first use this function)
one_window.cc:5: error: (Each undeclared identifier is reported only
once for
each function it appears in.)
one_window.cc:5: error: syntax error before `::' token
make[2]: *** [one_window.o] Error 1
make[2]: Leaving directory `/home/ruben/cplus/pharm/gmm/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ruben/cplus/pharm/gmm'
make: *** [all] Error 2
The resulting Makefile.in has
MYAPP_CFLAGS = @MYAPP_CFLAGS@
MYAPP_LIBS = @MYAPP_LIBS@
and the src level Makefile has
MYAPP_CFLAGS = -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API
-I/opt/gnome/include/gtkmm-2.4 -I/opt/gnome/lib/gtkmm-2.4/include
-I/opt/gnome/include/glibmm-2.4 -I/opt/gnome/lib/glibmm-2.4/include
-I/opt/gnome/include/gdkmm-2.4 -I/opt/gnome/lib/gdkmm-2.4/include
-I/opt/gnome/include/pangomm-1.4 -I/opt/gnome/include/atkmm-1.6
-I/opt/gnome/include/gtk-2.0 -I/opt/gnome/include/sigc++-2.0
-I/opt/gnome/lib/sigc++-2.0/include -I/opt/gnome/include/glib-2.0
-I/opt/gnome/lib/glib-2.0/include -I/opt/gnome/lib/gtk-2.0/include
-I/usr/X11R6/include -I/opt/gnome/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/freetype2/config
-I/opt/gnome/include/atk-1.0
MYAPP_LIBS = -L/opt/gnome/lib -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6
-lgtk-x11-2.0 -lpangomm-1.4 -lglibmm-2.4 -lsigc-2.0 -lgdk-x11-2.0
-latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
So I'm just lost here. What am I doing wrong?
--
http://www.mrbrklyn.com - Interesting Stuff
http://www.nylxs.com - Leadership Development in Free Software
So many immigrant groups have swept through our town that Brooklyn, like
Atlantis, reaches mythological proportions in the mind of the world - RI Safir
1998
http://fairuse.nylxs.com DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
"Yeah - I write Free Software...so SUE ME"
"The tremendous problem we face is that we are becoming sharecroppers to our
own cultural heritage -- we need the ability to participate in our own society."
"> I'm an engineer. I choose the best tool for the job, politics be damned.<
You must be a stupid engineer then, because politcs and technology have been
attached at the hip since the 1st dynasty in Ancient Egypt. I guess you missed
that one."
© Copyright for the Digital Millennium
Message not available