Re: autoheader, fortran, and comments

2007-04-11 Thread Stepan Kasal
Hello,

On Mon, Apr 09, 2007 at 03:47:46AM -0700, j y wrote:
> config.h: stamp-h1
>   @if test ! -f $@; then \
> rm -f stamp-h1; \
> $(MAKE) stamp-h1; \
>   else :; fi
>   sed -i '/\/\*|\*\//s/^/!/' config.h
> 
> Is there any way to do this by adding a macro or something to 
> configure.ac?  

sure there is, use a second parameter to AC_CONFIG_HEADERS, e.g.:

AC_CONFIG_HEADERS([config.h],
  [mv config.h config.hx &&
sed '/\/\*/,/\*\//s/^/!/' config.hx >config.h &&
rm config.hx])

(not tested, sorry)

The option -i to sed is GNU-specific, so I replaced it to increase
portability.  And I changed the sed cmd to adapt for comments which
span more than two lines.

Have a nice day,
Stepan Kasal




Re: Lost in automatic dependencies

2007-04-11 Thread Stephane Bortzmeyer
On Thu, Apr 05, 2007 at 05:09:44PM +0200,
 Ralf Wildenhues <[EMAIL PROTECTED]> wrote 
 a message of 21 lines which said:

> Just making sure: you said you removed config.cache, but what about
> $prefix/var/tmp/config.cache?

You're right. I deleted config.cache, $prefix/var/tmp/config.cache,
restored my config.site and rebuilt everything and it works. I now
have automatic dependencies. Thanks again.






Makefiles and libraries problem

2007-04-11 Thread Matí­as Alejandro Torres

Hi,

I'm a complete newbie with making automake makefiles. Before writing to 
this list I read the manual , I tried to look at source codes but I 
can't get things done.


Lets say i have a program i want to build and two libraries that resides 
in the same tarball, this is what the program structure looks:


src:
   Source code *.c *.h  #binary

   database/   #This should be a shared library.
   gtk/#This should be a shared library.


The command `make` throws an error when trying to build the database 
directory that says that there is no rule to build the objective `all`



The three makefiles  follow


**
The Makefile.am file in the src directory:
**

## Process this file with automake to produce Makefile.in

SUBDIRS = database gtk

INCLUDES = \
   -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
   -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
   -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
   $(PACKAGE_CFLAGS)

AM_CFLAGS =\
-Wall\
-g

bin_PROGRAMS = contacts

contacts_SOURCES = \
   callbacks.c\
   category.c\
   category.h\
   comparefunctions.c\
   comparefunctions.h\
   contact.c\
   contact.h\
   contacts.c\
   controllerfunctions.c\
   controllerfunctions.h\
   datefunctions.c\
   datefunctions.h\
   support.h\
   types.h

contacts_LDFLAGS =

contacts_LDADD = $(PACKAGE_LIBS)

EXTRA_DIST =


**
The Makefile.am in the database/ directory (a library)
**

contactsdb_la_SOURCES = idatabase.c\
   idatabase.h\
   sqlitedatabase.c\
   sqlitedatabase.h

lib_LTLIBRARIES = libcontactsdb.la


**
The Makefile.am in the gtk/ directory (a library)
**
contactsgui_la_SOURCES = aboutdialog.c \
   aboutdialog.h \
   calendarentry.c \
   calendarentry.h \
   categorybox.c \
   categorybox.h \
   categorycontroller.c \
   categorycontroller.h \
   categorymodel.c \
   categorymodel.h \
   contactbox.c \
   contactbox.h \
   contactcontroller.c \
   contactcontroller.h \
   contactmodel.c \
   contactmodel.h \
   contactwindow.c \
   contactwindow.h \
   menubar.c \
   menubar.h \
   optionbox.c \
   optionbox.h \
   toolbar.c \
   toolbar.h

lib_LTLIBRARIES = libcontactsgui.la