From ef01a19745d06249373382fc1031840a6a33d90f Mon Sep 17 00:00:00 2001 From: Luca Bigliardi Date: Wed, 11 Mar 2009 12:09:23 +0100 Subject: [PATCH] Build outside srcdir (1) Link is against top_builddir. TODO: fix javascript build --- bindings/perl/Makefile.am | 2 +- bindings/python/Makefile.am | 2 +- bindings/ruby/Makefile.am | 2 +- lib/ccvt/Makefile.am | 4 +++- src/Makefile.am | 16 ++++++++-------- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/bindings/perl/Makefile.am b/bindings/perl/Makefile.am index 6d417165..7bc50740 100644 --- a/bindings/perl/Makefile.am +++ b/bindings/perl/Makefile.am @@ -27,7 +27,7 @@ pkgperlexec_LTLIBRARIES = Freej.la Freej_la_LDFLAGS = -module -avoid-version Freej_la_CXXFLAGS = -I$(perl_archdir)/CORE $(FREEJ_FLAGS) @PERL_CFLAGS@ Freej_la_SOURCES = $(PERL_SOURCE) -Freej_la_LIBADD = -L$(top_srcdir)/src/.libs -lfreej +Freej_la_LIBADD = -L$(top_builddir)/src/.libs -lfreej clean-local: rm -rf .libs _libs diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am index 10e577af..d1f1bb59 100644 --- a/bindings/python/Makefile.am +++ b/bindings/python/Makefile.am @@ -26,7 +26,7 @@ pkgpython_instdir = $(pythondir) _freej_la_SOURCES = freej_py.cpp _freej_la_CXXFLAGS = $(FREEJ_FLAGS) @PYTHON_CPPFLAGS@ _freej_la_LDFLAGS = -module -avoid-version -_freej_la_LIBADD = $(PY_LIBS) -L$(top_srcdir)/src/.libs -lfreej +_freej_la_LIBADD = $(PY_LIBS) -L$(top_builddir)/src/.libs -lfreej clean-local: rm -rf .libs _libs diff --git a/bindings/ruby/Makefile.am b/bindings/ruby/Makefile.am index 6327522f..bef4447e 100644 --- a/bindings/ruby/Makefile.am +++ b/bindings/ruby/Makefile.am @@ -23,7 +23,7 @@ pkgrubyexec_LTLIBRARIES = Freej.la Freej_la_SOURCES = freej_ruby.cpp Freej_la_CXXFLAGS = $(FREEJ_FLAGS) @RUBY_CFLAGS@ Freej_la_LDFLAGS = $(RUBY_LDFLAGS) -module -avoid-version -Freej_la_LIBADD = $(RUBY_LIBS) -L$(top_srcdir)/src/.libs -lfreej +Freej_la_LIBADD = $(RUBY_LIBS) -L$(top_builddir)/src/.libs -lfreej clean-local: diff --git a/lib/ccvt/Makefile.am b/lib/ccvt/Makefile.am index 948c0c08..56b58703 100644 --- a/lib/ccvt/Makefile.am +++ b/lib/ccvt/Makefile.am @@ -1,4 +1,6 @@ -INCLUDES = -I$(top_srcdir)/ +# We need config.h so use top_builddir instead of top_srcdir +INCLUDES = -I$(top_builddir)/ + # Add INCLUDES to CFLAGS because it seems ignored while compiling .S files. CFLAGS += $(INCLUDES) diff --git a/src/Makefile.am b/src/Makefile.am index 024036cd..fd89dfb0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -102,13 +102,13 @@ JS_SOURCES = context_js.cpp \ audio_collector_js.cpp -static_libs = $(top_srcdir)/lib/ccvt/libccvt.la \ - $(top_srcdir)/lib/sdl_image/libsdl_image.la \ - $(top_srcdir)/lib/sdl_gfx/libsdl_gfx.la \ - $(top_srcdir)/lib/sdl_ttf/libsdl_ttf.la \ - $(top_srcdir)/lib/shout/libshout.la \ - $(top_srcdir)/lib/lo/liblo.la \ - $(top_srcdir)/lib/javascript/obj/libjs.a +static_libs = $(top_builddir)/lib/ccvt/libccvt.la \ + $(top_builddir)/lib/sdl_image/libsdl_image.la \ + $(top_builddir)/lib/sdl_gfx/libsdl_gfx.la \ + $(top_builddir)/lib/sdl_ttf/libsdl_ttf.la \ + $(top_builddir)/lib/shout/libshout.la \ + $(top_builddir)/lib/lo/liblo.la \ + $(top_builddir)/lib/javascript/obj/libjs.a shared_libs = -ldl -lpthread -lm -lslang -lpng -ljpeg -lrt \ @X11_LIBS@ \ @@ -139,6 +139,6 @@ libfreej_la_LDFLAGS = -version-info @FREEJ_VERSION_INFO@ bin_PROGRAMS = freej freej_SOURCES = freej.cpp -freej_LDADD = -L$(top_srcdir)/src/.libs -lfreej +freej_LDADD = -L$(top_builddir)/src/.libs -lfreej