[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Source code in two directories -- one shared library
From: |
Robin Rowe |
Subject: |
Source code in two directories -- one shared library |
Date: |
Sat, 10 May 2003 15:43:51 -0700 |
Hi. I have inherited a large project with a fairly complex automake build
system. I'm not an automake expert, and am having some trouble understanding
how to modify things -- or even how things work now. The automake
documentation I've read so far seems to just take one through the basics. Is
there anything I should read as someone learning automake in the context of
a more advanced project? Where should I look for answers?
To make our code easier to understand, I'm moving some C sources that can be
thought of as a module into a separate subdirectory. However, I don't want
to distribute two libs, just link it together into one shared library as it
was when all the files lived in the same directory. Moving some files to a
separate directory is just a little housekeeping, but automake seems to make
it into a difficult task.
Any suggestions for the following build problems?
The CinePaint source files for the wire protocol have been moved into a
separate subdirectory called wire, built as a lib, and linked into
libcinepaint.so. So far, so good -- at least so it seems.
Next, come the plug-ins. Those want to link to libcinepaint.so and
libwire.so, but wire was already linked into libcinepaint.so. Plug-ins
shouldn't be reaching out for libwire.so, but it isn't clear to me where the
plug-ins were configured to grab libwire.so. Some sort of auto-magic in GNU
auto tools?
Here's the make output for the blur plug-in:
/bin/sh ../../libtool --mode=link gcc -g -O2 -Wall -o blur blur.o
../../lib/libcinepaintui.la
../../lib/libcinepaint.la -L/usr/lib -L/usr/X11R6/lib -lgtk -l
gdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm
-lc
gcc -g -O2 -Wall -o .libs/blur blur.o -rdynamic
../../lib/.libs/libcinepaintui.so ../../lib/.libs/libcinepaint.so
/home/rower/cinepaint-project/cinepaint-0.16-3/wire/.libs/libwire.so -L/usr/
lib -L/usr/X11R6/lib /usr/lib/libgtk.so /usr/lib/libgdk.so
/usr/lib/libgmodule.so
/usr/lib/libglib.so -ldl -lXi -lXext -lX11 -lm -lc -Wl,--rpath -Wl,/usr/loca
l/lib
/home/rower/cinepaint-project/cinepaint-0.16-3/wire/.libs/libwire.so:
undefined reference to `eprintf'
../../lib/.libs/libcinepaint.so: undefined reference to `dputs'
../../lib/.libs/libcinepaint.so: undefined reference to `TaskSwitchToWire'
../../lib/.libs/libcinepaint.so: undefined reference to `eputs'
/home/rower/cinepaint-project/cinepaint-0.16-3/wire/.libs/libwire.so:
undefined reference to `wire_buffer'
collect2: ld returned 1 exit status
Any idea where libwire.so is coming from, how to turn that off from linking
into plug-ins like blur?
Why are there undefined references in libcinpaint (from wire)? Is wire not
really linked into libcinepaint.so?
Is there anything wacky about our Mafefile.am files? Included below are our
top Makefile.am, wire/Makefile.am, lib/Makefile.am, and
plug-ins/blur/Makefile.am.
Is there a better way to do any of this?
Thanks!
Robin
---------------------------------------------------------------------------
address@hidden Hollywood, California
www.CinePaint.org Free motion picture and still image editing software
## cinepaint/Makefile.am
## Process this file with automake to produce Makefile.in
SUBDIRS = wire lib plug-ins app data
bin_SCRIPTS = cinepainttool
EXTRA_DIST = gtkrc logo.ppm plash.ppm rmshm user_install tips.txt \
ps-menurc cinepaint.1 cinepainttool.1 gtkrc.forest2 cinepaint.m4
cinepaint.spec \
pixmaps/wilber.xpm \
pixmaps/wilber2.xpm \
pixmaps/chain.xpm
cinepaintdata_DATA = cinepaintrc cinepaintrc_user gtkrc logo.ppm splash.ppm
tips.txt ps-menurc gtkrc.forest2
cinepaintdata_SCRIPTS = user_install
man_MANS=cinepaint.1 cinepainttool.1
m4datadir = $(datadir)/aclocal
m4data_DATA = cinepaint.m4
scriptdata =
.PHONY: files populate checkin release
files:
@files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \
echo $$p; \
done
@for subdir in $(SUBDIRS); do \
files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \
for file in $$files; do \
echo $$subdir/$$file; \
done; \
done
populate:
@echo "populating project"
@files=`$(MAKE) files | grep -v "make\[[1-9]\]"`; prcs populate -d
cinepaint.prj $$files
checkin: populate
@echo "checking in project"
@prcs checkin
release:
$(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
RPMARCH=`rpm --showrc | awk '/^build arch/ {print $$4}'`
rpm: dist
mkdir -p rpmdir/BUILD \
rpmdir/SPECS \
rpmdir/SOURCES \
rpmdir/SRPMS \
rpmdir/RPMS/$(RPMARCH)
cp -f $(PACKAGE)-$(VERSION).tar.gz rpmdir/SOURCES
$(RPMBUILD) --clean -ba $(top_srcdir)/$(PACKAGE).spec --define "_topdir
$$PWD/rpmdir"
@echo "============================================================"
@echo "Finished - the packages are in rpmdir/RPMS and rpmdir/SRPMS!"
----------------------------------------------------------------------------
-------
## cinepaint/wire/Makefile.am
## Process this file with automake to produce Makefile.in
cinepaintincludedir = $(includedir)/cinepaint-$(VERSION)/lib
scriptdata =
EXTRA_DIST =
##lib_LTLIBRARIES = libwire.la
noinst_LTLIBRARIES = libwire.la
noinst_LIBRARIES = libwire.a
libwire_la_SOURCES = protocol.c \
protocol.h \
wire.c \
wire.h
libwire_a_SOURCES = protocol.c \
protocol.h \
wire.c \
wire.h
cinepaintinclude_HEADERS = enums.h
libwire_la_LDFLAGS = -version-info
$(MAJOR_VERSION):$(MINOR_VERSION):$(MICRO_VERSION)
CPPFLAGS = \
-DCINEPAINTDIR=\""$(cinepaintdir)"\"
INCLUDES = \
$(X_CFLAGS) \
-I$(top_srcdir) \
-I$(includedir)
.PHONY: files
files:
@files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \
echo $$p; \
done
----------------------------------------------------------------------------
-
## cinepaint/lib/Makefile.am
## Process this file with automake to produce Makefile.in
cinepaintincludedir = $(includedir)/cinepaint-$(VERSION)/lib
scriptdata =
EXTRA_DIST = version.h.in
lib_LTLIBRARIES = libcinepaint.la libcinepaintui.la
noinst_LIBRARIES = libcinepainti.a
libcinepaint_la_LIBADD = ../wire/libwire.la
PDB_WRAPPERS_C = \
plugin_pdb.c \
unit_pdb.c
PDB_WRAPPERS_H = \
pdb.h \
unit_pdb.h
libcinepainti_a_SOURCES = plugin_pdb.h \
gpixmap.c \
gpixmap.h \
widgets.c \
widgets.h \
gdialog.c \
gdialog.h \
size_entry.c \
size_entry.h \
helpui.c \
helpui.h \
unitmenu.c \
unitmenu.h \
chainbutton.c \
chainbutton.h
if STATICLIBS
libcinepainti_a_DEPENDENCIES = libcinepaint.la
endif
libcinepaint_la_SOURCES = plugin_main.c \
${PDB_WRAPPERS_C} \
${PDB_WRAPPERS_H} \
channel.c \
gdisplay.c \
gdrawable.c \
gradient.c \
gimage.c \
player.c \
gpalette.c \
pixelrgn.c \
tile.c \
unit.c \
unit.h
libcinepaintui_la_SOURCES = gmenu.c
cinepaintinclude_HEADERS = plugin_main.h \
${PDB_WRAPPERS_H} \
gmath.h \
glimits.h \
config.h \
version.h \
intl.h \
float16.h \
gmenu.h \
ui.h
libcinepaint_la_LDFLAGS = -version-info
$(MAJOR_VERSION):$(MINOR_VERSION):$(MICRO_VERSION)
libcinepaintui_la_LDFLAGS = -version-info
$(MAJOR_VERSION):$(MINOR_VERSION):$(MICRO_VERSION)
CPPFLAGS = \
-DCINEPAINTDIR=\""$(cinepaintdir)"\"
INCLUDES = \
$(X_CFLAGS) \
-I$(top_srcdir) \
-I$(includedir) \
-I../wire
.PHONY: files
files:
@files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \
echo $$p; \
done
----------------------------------------------------------------------------
## cinepaint/plug-ins/blur/Makefile.am
## Process this file with automake to produce Makefile.in
pluginlibdir = $(cinepaintplugindir)/plug-ins
pluginlib_PROGRAMS = blur
blur_SOURCES = \
blur.c
INCLUDES = \
$(X_CFLAGS) \
-I$(top_srcdir) \
-I$(includedir)
LDADD = \
$(top_builddir)/lib/libcinepaintui.la \
$(top_builddir)/lib/libcinepaint.la \
$(X_LIBS) \
\
-lc
DEPS = \
$(top_builddir)/lib/libcinepaintui.la \
$(top_builddir)/lib/libcinepaint.la
blur_DEPENDENCIES = $(DEPS)
.PHONY: files
files:
@files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \
echo $$p; \
done
@for subdir in $(SUBDIRS); do \
files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \
for file in $$files; do \
echo $$subdir/$$file; \
done; \
done
----------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Source code in two directories -- one shared library,
Robin Rowe <=