$NetBSD: patch-ac,v 1.2 2006/02/18 14:07:54 joerg Exp $ --- src/Makefile.orig 2005-02-03 15:11:44.000000000 +0000 +++ src/Makefile @@ -42,7 +42,10 @@ OUT_MAGIC := $(shell mkdir $(EFLTK_TOPDI ################################################################ FLDIRS = core widgets db -DIRS = xml images opengl net +DIRS = xml images net +ifeq ($(HAVE_OPENGL),yes) +DIRS+= opengl +endif LIBNAME = libefltk DSOLIBNAME = $(LIBNAME) @@ -52,6 +55,18 @@ DSONAME = $(LIBNAME)$(DSOEXT) all: $(BUILDTARGETS) +libtool: + @rm -f $(LIBRARY).la + @for dir in $(FLDIRS); do\ + if test ! -f $$dir/makedepend; then touch $$dir/makedepend; fi;\ + (cd $$dir;$(MAKE) $(MFLAGS) libtool) || exit;\ + done + $(MAKE) $(LIBRARY).la + @for dir in $(DIRS); do\ + if test ! -f $$dir/makedepend; then touch $$dir/makedepend; fi;\ + (cd $$dir;$(MAKE) $(MFLAGS) libtool) || exit;\ + done + static: @rm -f $(LIBRARY)$(LIBEXT) @for dir in $(FLDIRS); do\ @@ -80,12 +95,17 @@ programs: STATIC_OBJECTS = core/*.static.o widgets/*.static.o db/*.static.o SHARED_OBJECTS = core/*.shared.o widgets/*.shared.o db/*.shared.o +LIBTOOL_OBJECTS = core/*.lo widgets/*.lo db/*.lo $(LIBRARY).a: @echo $(LIBCOMMAND) $@ ... @$(LIBCOMMAND) $@ $(STATIC_OBJECTS) @$(RANLIB) $@ +${LIBRARY}.la: + ${LIBTOOL} --mode=link ${CXX} -o $@ ${CXXFLAGS} ${LDFLAGS} \ + -rpath ${libdir} -version-info 2:0 ${LIBTOOL_OBJECTS} ${DSOLIBS} + $(DSO).so.$(FL_API_VERSION) $(DSO).sl.2: @rm -f $@ @echo $(DSOCOMMAND) $(DSONAME) ... @@ -130,6 +150,15 @@ install_static: static (cd $$dir;$(MAKE) $(MFLAGS) install_static) || exit;\ done +install_libtool: libtool + @echo "Installing libraries..." + ${BSD_INSTALL_DATA_DIR} $(libdir) + ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} ${LIBRARY}.la ${libdir} + @for dir in $(DIRS) $(FLDIRS); do\ + if test ! -f $$dir/makedepend; then touch $$dir/makedepend; fi;\ + (cd $$dir;$(MAKE) $(MFLAGS) install_libtool) || exit;\ + done + install_shared: shared @echo "Installing shared libraries..." @rm -f $(libdir)/$(DLLIMPORTNAME)