Add a package in the build tool

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Add a package in the build tool

Mathieu Suen-2
Hi,

I am trying to write the configure.ac  Makefile.am so that when I do a make make install  it
build a package:

I have add the gst-package.m4 from the build-aux of gst.
Then here is what the configure.ac look like:

AC_CONFIG_MACRO_DIR([m4])

m4_include([build-aux/lightning.m4])
m4_include([build-aux/gst-package.m4])

AC_INIT([package], [version])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])

LIGHTNING_CONFIGURE_IF_NOT_FOUND([], [])

GST_PACKAGE_ENABLE([Lightning], [gst-lightning])

AC_PROG_CC
AC_CONFIG_FILES([Makefile])

AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)

AC_OUTPUT

But the package is not build.
I might miss some stuff in the Makefile.am

Thanks for help

  Mathk





_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Add a package in the build tool

Paolo Bonzini-2
On 07/02/2010 02:46 PM, Mathieu Suen wrote:
> Hi,
>
> I am trying to write the configure.ac  Makefile.am so that when I do a make make install  it
> build a package:
>
> I have add the gst-package.m4 from the build-aux of gst.

I suggest you look at the output of gst-package --prepare.

Anyway.

> AC_CONFIG_MACRO_DIR([m4])

If you use this...

> m4_include([build-aux/lightning.m4])
> m4_include([build-aux/gst-package.m4])

... you should instead use aclocal.  No need to put the files in
build-aux/ (especially gst-package.m4), they will automatically be put
in m4/ instead by aclocal.

> AC_INIT([package], [version])
> AM_INIT_AUTOMAKE([foreign subdir-objects])
> AC_CONFIG_SRCDIR([configure.ac])
> AC_CONFIG_HEADERS([config.h])
>
> LIGHTNING_CONFIGURE_IF_NOT_FOUND([], [])
>

Add here:

AM_PATH_GST([3.2])

> GST_PACKAGE_ENABLE([Lightning], [gst-lightning])
>
> AC_PROG_CC
> AC_CONFIG_FILES([Makefile])

Add here:

AC_CONFIG_FILES([gst], [chmod +x gst])

> AC_PROG_LIBTOOL
> AC_SUBST(LIBTOOL_DEPS)
>
> AC_OUTPUT

The rest is okay.

> But the package is not build.
> I might miss some stuff in the Makefile.am

Yes:

DISTCLEANFILES = pkgrules.tmp
all-local:
clean-local::
install-data-hook::
dist-hook::
uninstall-local::

@PACKAGE_RULES@

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re : [Help-smalltalk] Add a package in the build tool

Mathieu Suen-2
Thanks Paolo.

I did try out a couple of things.

I have add all waht you said into the configure.ac and Makefile.am;

But I got the following error.

$ autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal
configure.ac:11: warning: macro `AM_PATH_GST' not found in library
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --install --copy
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:11: warning: macro `AM_PATH_GST' not found in library
autoreconf: running: /usr/bin/autoconf
configure.ac:11: error: possibly undefined macro: AM_PATH_GST
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

I am not familiar with the m4 script. Is that the aclocal running with the autoreconf -vi?

 I also added
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux])

If I understand it correctly aclocal is going to output all the m4 file in it.

Have you an idea wihy I got the  'warning: macro `AM_PATH_GST' not found in library'?

Thanks


Mathieu Suen


----- Message d'origine ----
De : Paolo Bonzini <[hidden email]>
On 07/02/2010 02:46 PM, Mathieu Suen wrote:
> Hi,
>
> I am trying to write the configure.ac  Makefile.am so that when I do a make make install  it
> build a package:
>
> I have add the gst-package.m4 from the build-aux of gst.

I suggest you look at the output of gst-package --prepare.

Anyway.

> AC_CONFIG_MACRO_DIR([m4])

If you use this...

> m4_include([build-aux/lightning.m4])
> m4_include([build-aux/gst-package.m4])

... you should instead use aclocal.  No need to put the files in
build-aux/ (especially gst-package.m4), they will automatically be put
in m4/ instead by aclocal.

Add here:

AM_PATH_GST([3.2])

> GST_PACKAGE_ENABLE([Lightning], [gst-lightning])
>
> AC_PROG_CC
> AC_CONFIG_FILES([Makefile])

Add here:




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : [Help-smalltalk] Add a package in the build tool

Paolo Bonzini-2
First of all,

> libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

Do so. :)

> I am not familiar with the m4 script. Is that the aclocal running with the autoreconf -vi?

Yes.  It is already running, you're just not relying on it fully.
Anyway, that's not a problem.

> AC_CONFIG_AUX_DIR([build-aux])
> AC_CONFIG_MACRO_DIR([build-aux])

Yes.  AUX_DIR is fine, but I suggest you use a separate directory as
your MACRO_DIR (e.g. name it "m4").

> Have you an idea wihy I got the  'warning: macro `AM_PATH_GST' not found in library'?

Maybe you installed gst in /usr/local?  I suggest you create symbolic
links from /usr/share/aclocal/{gst,gst-package}.m4 to the corresponding
files in /usr/local/share/aclocal if this is the case.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : [Help-smalltalk] Add a package in the build tool

Mathieu Suen-2
Ok so I check the /usr/local/share/aclocal here what I get:
$ ls /usr/local/share/aclocal/
gst.m4  gst-package.m4  lightning.m4  snprintfv.m4


Here is my configure.ac:
----------------------------------------------
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])

#m4_include([build-aux/lightning.m4])

AC_INIT([GST-GNU lightning], [0.0])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])


LIGHTNING_CONFIGURE_IF_NOT_FOUND([], [])

AM_PATH_GST([3.2])
AC_PROG_CC
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([gst], [chmod +x gst])

AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)

AC_OUTPUT
----------------------------------------------


And my Makefile.am:
----------------------------------------------
# build gst-lightning
#
AM_CPPFLAGS = -I$(INCLIGHTNING)
ACLOCAL_AMFLAGS = -I m4

if !HAVE_INSTALLED_LIGHTNING
AM_CPPFLAGS += -I$(top_srcdir)/lightning -I$(top_builddir)/lightning
endif

lib_LTLIBRARIES = libgstlightning.la
libgstlightning_la_SOURCES = gst-lightning.c gst-lightning.h

DISTCLEANFILES = pkgrules.tmp
all-local:
clean-local::
install-data-hook::
dist-hook::
uninstall-local::

@PACKAGE_RULES@
----------------------------------------------


And here the output:
$ autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
configure.ac:14: warning: macro `AM_PATH_GST' not found in library
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --install --copy
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
libtoolize: copying file `build-aux/config.guess'
libtoolize: copying file `build-aux/config.sub'
libtoolize: copying file `build-aux/install-sh'
libtoolize: copying file `build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:14: warning: macro `AM_PATH_GST' not found in library
autoreconf: running: /usr/bin/autoconf
configure.ac:14: error: possibly undefined macro: AM_PATH_GST
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1


Did I miss something ?


Thanks a lot

        Mth




On Jul 2, 2010, at 5:48 PM, Paolo Bonzini wrote:

> First of all,
>
>> libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
>
> Do so. :)
>
>> I am not familiar with the m4 script. Is that the aclocal running with the autoreconf -vi?
>
> Yes.  It is already running, you're just not relying on it fully. Anyway, that's not a problem.
>
>> AC_CONFIG_AUX_DIR([build-aux])
>> AC_CONFIG_MACRO_DIR([build-aux])
>
> Yes.  AUX_DIR is fine, but I suggest you use a separate directory as your MACRO_DIR (e.g. name it "m4").
>
>> Have you an idea wihy I got the  'warning: macro `AM_PATH_GST' not found in library'?
>
> Maybe you installed gst in /usr/local?  I suggest you create symbolic links from /usr/share/aclocal/{gst,gst-package}.m4 to the corresponding files in /usr/local/share/aclocal if this is the case.
>
> Paolo


       

       
               
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : [Help-smalltalk] Add a package in the build tool

Mathieu Suen-2
Eventually I manage it by adding
ACLOCAL_AMFLAGS = -I m4 -I /usr/local/share/aclocal
in the Makefile.am

But I don't think that is the right solution

        Mth




On Jul 2, 2010, at 9:14 PM, Mathieu Suen wrote:

> Ok so I check the /usr/local/share/aclocal here what I get:
> $ ls /usr/local/share/aclocal/
> gst.m4  gst-package.m4  lightning.m4  snprintfv.m4
>
>
>
>
> And my Makefile.am:
> ----------------------------------------------
> # build gst-lightning
> #
> AM_CPPFLAGS = -I$(INCLIGHTNING)
> ACLOCAL_AMFLAGS = -I m4
>
> if !HAVE_INSTALLED_LIGHTNING
> AM_CPPFLAGS += -I$(top_srcdir)/lightning -I$(top_builddir)/lightning
> endif
>
> lib_LTLIBRARIES = libgstlightning.la
> libgstlightning_la_SOURCES = gst-lightning.c gst-lightning.h
>
> DISTCLEANFILES = pkgrules.tmp
> all-local:
> clean-local::
> install-data-hook::
> dist-hook::
> uninstall-local::
>
> @PACKAGE_RULES@
> ----------------------------------------------
>
>
>
> Did I miss something ?
>
>
> Thanks a lot
>
> Mth
>
>
>


       

       
               
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : [Help-smalltalk] Add a package in the build tool

Mathieu Suen-2
Now I got an other error:

$ autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4 -I /usr/local/share/aclocal
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --install --copy
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:10: installing `build-aux/missing'
configure.ac:20: required file `gst.in' not found
Makefile.am: installing `build-aux/depcomp'
autoreconf: automake failed with exit status: 1


        Mth




On Jul 2, 2010, at 9:42 PM, Mathieu Suen wrote:

> Eventually I manage it by adding
> ACLOCAL_AMFLAGS = -I m4 -I /usr/local/share/aclocal
> in the Makefile.am
>
> But I don't think that is the right solution
>
> Mth
>
>
>
>
> On Jul 2, 2010, at 9:14 PM, Mathieu Suen wrote:
>
>> Ok so I check the /usr/local/share/aclocal here what I get:
>> $ ls /usr/local/share/aclocal/
>> gst.m4  gst-package.m4  lightning.m4  snprintfv.m4
>>
>>
>>
>>
>> And my Makefile.am:
>> ----------------------------------------------
>> # build gst-lightning
>> #
>> AM_CPPFLAGS = -I$(INCLIGHTNING)
>> ACLOCAL_AMFLAGS = -I m4
>>
>> if !HAVE_INSTALLED_LIGHTNING
>> AM_CPPFLAGS += -I$(top_srcdir)/lightning -I$(top_builddir)/lightning
>> endif
>>
>> lib_LTLIBRARIES = libgstlightning.la
>> libgstlightning_la_SOURCES = gst-lightning.c gst-lightning.h
>>
>> DISTCLEANFILES = pkgrules.tmp
>> all-local:
>> clean-local::
>> install-data-hook::
>> dist-hook::
>> uninstall-local::
>>
>> @PACKAGE_RULES@
>> ----------------------------------------------
>>
>>
>>
>> Did I miss something ?
>>
>>
>> Thanks a lot
>>
>> Mth
>>
>>
>>
>
>
>
>
>
>
> ___________________________________________________________________________
> Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
> http://fr.mail.yahoo.com
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk


       

       
               
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : [Help-smalltalk] Add a package in the build tool

Paolo Bonzini-2
> configure.ac:20: required file `gst.in' not found

Remove the AC_CONFIG_FILES([gst]) line, I'll answer more in depth when
I get a connection again.  (gst-package --prepare would create it).

You didn't create links in /usr/share/aclocal.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : [Help-smalltalk] Add a package in the build tool

Mathieu Suen-2
On Jul 2, 2010, at 10:43 PM, Paolo Bonzini wrote:

>> configure.ac:20: required file `gst.in' not found
>
> Remove the AC_CONFIG_FILES([gst]) line, I'll answer more in depth when
> I get a connection again.  (gst-package --prepare would create it).

Ok thanks

>
> You didn't create links in /usr/share/aclocal.

Oops I got it the other way round.
Now I manage to build my package.
The only remaining issue is the installation directory of the package.

configure.ac
-----------------------------------------------
AC_INIT([GST-GNU lightning], [0.0])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])

LIGHTNING_CONFIGURE_IF_NOT_FOUND([], [])

GST_PACKAGE_ENABLE([Lightning], [gst-lightning])

AM_PATH_GST([3.2])

AC_PROG_CC

AC_CONFIG_FILES([Makefile])

AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)

AC_OUTPUT
-----------------------------------------------

Makefile.am
-----------------------------------------------
# build gst-lightning
#
AM_CPPFLAGS = -I$(INCLIGHTNING)
ACLOCAL_AMFLAGS = -I m4 -I /usr/local/share/aclocal # FIX-ME

gstdatadir=$(pkgdatadir)

if !HAVE_INSTALLED_LIGHTNING
AM_CPPFLAGS += -I$(top_srcdir)/lightning -I$(top_builddir)/lightning
endif

lib_LTLIBRARIES = libgstlightning.la
libgstlightning_la_SOURCES = gst-lightning.c gst-lightning.h

DISTCLEANFILES = pkgrules.tmp
all-local:
clean-local::
install-data-hook::
dist-hook::
uninstall-local::

@PACKAGE_RULES@
-----------------------------------------------


I have added gstdatadir=$(pkgdatadir) into the Makefile.am but the package is install in /usr/local/share/gst-lightning.

gst-package --srcdir . --target-directory=/usr/local/share/gst-lightning --destdir "" Lightning.star

And PackageLoader does not find the package.

I tried without gstdatadir=$(pkgdatadir) but I get an error:

gst-package --srcdir . --target-directory= --destdir "" Lightning.star
Object: '' error: Invalid index 1: index out of range


So how to tell to install under the default path (/usr/local/share/smalltalk)
Thanks

>
> Paolo

Math


       

       
               
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : [Help-smalltalk] Add a package in the build tool

Paolo Bonzini-2
> AM_CPPFLAGS = -I$(INCLIGHTNING)
> ACLOCAL_AMFLAGS = -I m4 -I /usr/local/share/aclocal # FIX-ME
>
> gstdatadir=$(pkgdatadir)

Why? It should not be needed, gst.m4 sets it.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re : Re : [Help-smalltalk] Add a package in the build tool

Mathieu Suen-2
If I don't add this line I got:

make[2]: Entering directory `/home/mathieu/gst-lightning'
/usr/local/bin/gst-package --srcdir . --target-directory= --destdir "" Lightning.star
Object: '' error: Invalid index 1: index out of range
SystemExceptions.IndexOutOfRange(Exception)>>pass (ExcHandling.st:385)
optimized [] in UndefinedObject>>executeStatements (/usr/local/share/smalltalk/scripts/Package.st:1190)

The gst version is
$ gst --version
GNU Smalltalk version 3.2-4c508c1




----- Message d'origine ----
De : Paolo Bonzini <[hidden email]>
À : Mathieu Suen <[hidden email]>
Cc : GNU Smalltalk <[hidden email]>
Envoyé le : Lun 5 juillet 2010, 12h 03min 34s
Objet : Re: Re : [Help-smalltalk] Add a package in the build tool

> AM_CPPFLAGS = -I$(INCLIGHTNING)
> ACLOCAL_AMFLAGS = -I m4 -I /usr/local/share/aclocal # FIX-ME
>
> gstdatadir=$(pkgdatadir)

Why? It should not be needed, gst.m4 sets it.

Paolo





_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : Re : [Help-smalltalk] Add a package in the build tool

Paolo Bonzini-2
On Mon, Jul 5, 2010 at 13:39, Mathieu Suen <[hidden email]> wrote:
> If I don't add this line I got:
>
> make[2]: Entering directory `/home/mathieu/gst-lightning'
> /usr/local/bin/gst-package --srcdir . --target-directory= --destdir "" Lightning.star
> Object: '' error: Invalid index 1: index out of range
> SystemExceptions.IndexOutOfRange(Exception)>>pass (ExcHandling.st:385)
> optimized [] in UndefinedObject>>executeStatements (/usr/local/share/smalltalk/scripts/Package.st:1190)

Ok, I'll look at it.  For now set

gstdatadir=$(datadir)/smalltalk

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : Re : Add a package in the build tool

Paolo Bonzini-2
On 07/05/2010 06:33 PM, Paolo Bonzini wrote:

> On Mon, Jul 5, 2010 at 13:39, Mathieu Suen<[hidden email]>  wrote:
>> If I don't add this line I got:
>>
>> make[2]: Entering directory `/home/mathieu/gst-lightning'
>> /usr/local/bin/gst-package --srcdir . --target-directory= --destdir "" Lightning.star
>> Object: '' error: Invalid index 1: index out of range
>> SystemExceptions.IndexOutOfRange(Exception)>>pass (ExcHandling.st:385)
>> optimized [] in UndefinedObject>>executeStatements (/usr/local/share/smalltalk/scripts/Package.st:1190)
>
> Ok, I'll look at it.  For now set
>
> gstdatadir=$(datadir)/smalltalk

Will push a fix to smalltalk.git in a second.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk