Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Subsume external project into my autotools project [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
tenspd137
Guru
Guru


Joined: 22 Aug 2006
Posts: 391

PostPosted: Fri Oct 03, 2014 3:11 am    Post subject: Subsume external project into my autotools project [solved] Reply with quote

Hi all,

I can't seem to find a good answer to this anywhere. I have a project where I want to use other libraries, say libjpeg-turbo. Instead of looking for it on the users system, I would like to put the source into my project - so the tree would look like

project-----configure.ac, Makefile.am
|
external------libjpeg-turbo
|
src-----Makefile.am, my project sources

How would I tell my project to build libjpeg-turbo - ie run it's configure scripts, etc?

So far, I made a small test.

toplevel config.ac:
Code:

AC_INIT(test, 1.0)
AC_CONFIG_SRCDIR(src/main.cpp)

AM_INIT_AUTOMAKE

AC_PROG_CXX
AC_PROG_LIBTOOL

AC_OUTPUT(Makefile src/Makefile)


Toplevel Makefile.am
Code:

SUBDIRS = extern/libjpeg-turbo-1.3.1 src


src Makefile.am
Code:

bin_PROGRAMS = test

test_SOURCES = main.cpp
test_LDADD = $(top_srcdir)/external/libjpeg-turbo-1.3.1/libjpeg.la


Everything I have seen (which hasn't had any examples) suggests if I set it up like this it would work. Basically, I would like it to also build the libjpeg-turbo source - how do I get it to run the configure script from my top level?

Thanks for any help!


************************

Found it - AC_CONFIG_SUBDIRS - hard to find what you are looking for when you don't know what it is called.

*************************
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21631

PostPosted: Sat Oct 04, 2014 12:32 am    Post subject: Reply with quote

Fair warning - package distributors discourage bundling or sometimes outright ban it. If you insist on bundling a version of some other package, please include a configure option to use the system copy instead.
Back to top
View user's profile Send private message
tenspd137
Guru
Guru


Joined: 22 Aug 2006
Posts: 391

PostPosted: Wed Oct 22, 2014 2:47 am    Post subject: Reply with quote

Sorry for the late reply - thank you. This is just for a research project at work where we want to be sure we are linking against the same libraries - it isn't something to be redistributed to the outside world, but I do plan on adding options to do as you suggest as I learn autotools.

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum