From ead5d54e4bf9c0463d11bbd0eb8949da6150ae5d Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 7 Oct 2014 10:53:09 -0400 Subject: [PATCH] Bug 444688 - Autotools shared lib example not building - make changes to default shared library template to handle changes made to external autotools - add the rpath specification to the exampleProgram build so it will just run without having to set LD_LIBRARY_PATH Change-Id: I299c274bc07e91bbe6cf955c5391faf4f87b3edc Reviewed-on: https://git.eclipse.org/r/34531 Tested-by: Hudson CI Reviewed-by: Jeff Johnston Tested-by: Jeff Johnston (cherry picked from commit e39e96bd9cbf0ff958080ebb1637f90288dd2a18) Reviewed-on: https://git.eclipse.org/r/34602 --- .../AutotoolsSharedLibraryProject/Makefile.am | 1 + .../AutotoolsSharedLibraryProject/configure.ac | 6 ++---- .../exampleProgram/Makefile.am | 7 ++++++- .../AutotoolsSharedLibraryProject/template.xml | 5 +++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/Makefile.am b/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/Makefile.am index dd87335016d..efd24311de9 100644 --- a/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/Makefile.am +++ b/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/Makefile.am @@ -1 +1,2 @@ SUBDIRS=$(libName) include exampleProgram +ACLOCAL_AMFLAGS=-I m4 diff --git a/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/configure.ac b/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/configure.ac index 85c2c362651..db600beea03 100644 --- a/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/configure.ac +++ b/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/configure.ac @@ -6,6 +6,8 @@ AC_PROG_CC AC_CANONICAL_SYSTEM +AC_CONFIG_MACRO_DIR([m4]) + dnl Initialize automake AM_INIT_AUTOMAKE @@ -15,10 +17,6 @@ AM_PROG_CC_C_O dnl Initialize Libtool LT_INIT -dnl Check if Libtool is present -dnl Libtool is used for building share libraries -AC_PROG_LIBTOOL - AC_CONFIG_FILES(Makefile exampleProgram/Makefile $(libName)/Makefile diff --git a/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/exampleProgram/Makefile.am b/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/exampleProgram/Makefile.am index 9c61633ad4d..2b6dd211636 100644 --- a/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/exampleProgram/Makefile.am +++ b/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/exampleProgram/Makefile.am @@ -15,11 +15,16 @@ noinst_PROGRAMS=exampleProgram # replaced by '_'. So a.out becomes a_out and the appropriate suffex added. # '_SOURCES' for example. +ACLOCAL_AMFLAGS=-I ../m4 + # Sources for the a.out exampleProgram_SOURCES= exampleProgram.c +# Libraries for a.out +exampleProgram_LDADD = $(top_srcdir)/$(libName)/$(libName).la + # Linker options for a.out -exampleProgram_LDFLAGS = $(top_srcdir)/$(libName)/$(libName).la +exampleProgram_LDFLAGS = -rpath `cd $(top_srcdir);pwd`/$(libName)/.libs # Compiler options for a.out exampleProgram_CPPFLAGS = -I$(top_srcdir)/include diff --git a/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/template.xml b/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/template.xml index b55e4d86ae8..e9978ef1353 100644 --- a/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/template.xml +++ b/build/org.eclipse.cdt.autotools.ui/templates/projecttemplates/AutotoolsSharedLibraryProject/template.xml @@ -52,6 +52,11 @@ + + + + +