Michael Goffioul wrote:
> On Thu, Mar 27, 2008 at 12:06 PM, David Bateman
> <[EMAIL PROTECTED]> wrote:
>   
>>  Yes, but that breaks the use of the fixed type in other oct-files.. See
>>  the examples directory in the fixed package.. I don't really understand
>>  Windows builds.. Might it be possible to flag the OCTAVE_API macro in
>>  the fixed type and build under cygwin, mingw and MSVC linking against
>>  the oct-file rather than an external DLL. If that is the case, I'd say
>>  we get rid of the DLL complete and do it that way.
>>     
>
> Maybe I miss something, because this is already what the MSVC build does
> (or at least it used to be like that; I made it like that...). The MSVC build 
> do
> not use a separate DLL anymore. Everything is built into the oct-file, but I
> use the OCTAVE_FIXED_API macro to export the main symbols from the
> oct-file. The oct-files in the examples directory are then simply linked
> against the main oct-file.
>
> Michael.
>
>   
If we can do the same under mingw, cygwin and msvc, then I'd suggest the
attached patch.. Tatsuro, could you check to see if you can do the
following in a freshly checked out octave-forge SVN with this patch applied

cd main/fixed/src
./autogen.sh
./configure
make
cd ../examples
make
octave
addpath ("../src")
a = ffft(fixed(6,4,32*randn(64,1)))

If you can then this patch is find with cygwin/mingw..

D.

-- 
David Bateman                                [EMAIL PROTECTED]
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

Index: main/fixed/src/Makefile
===================================================================
--- main/fixed/src/Makefile     (revision 4811)
+++ main/fixed/src/Makefile     (working copy)
@@ -3,35 +3,18 @@
 FIXEDVERTARGET = fixedversion.h
 FIXEDTARGET = fixed.oct 
 
-LIBPRE = lib
-LIBEXT = dll
-LIBIMPEXT = dll.a
 DLLDEF =
-ISMS =
 ifneq (,$(findstring cygwin,$(canonical_host_type)))
-   OCT_INCLUDES_LIB = 1
-   ISMS = 1
    DLLDEF = -DFIXED_DLL
-   FIXEDIMPTARGET = $(LIBPRE)octave_fixed.$(LIBIMPEXT)
-   ADD_FLAGS = -Wl,--out-implib=$(FIXEDIMPTARGET)
 endif
 ifneq (,$(findstring mingw,$(canonical_host_type)))
-   OCT_INCLUDES_LIB = 1
-   ISMS = 1
    DLLDEF = -DFIXED_DLL
-   FIXEDIMPTARGET = $(LIBPRE)octave_fixed.$(LIBIMPEXT)
-   ADD_FLAGS = -Wl,--out-implib=$(FIXEDIMPTARGET)
 endif
 ifneq (,$(findstring msdosmsvc,$(canonical_host_type)))
-   OCT_INCLUDES_LIB = 1
-   ISMS = 1
-   LIBPRE =
-   LIBIMPEXT = lib
    DLLDEF = -DFIXED_DLL
 endif
 
-ifeq (1,$(OCT_INCLUDES_LIB))
-  FIXEDSOURCES = fixedColVector.cc fixedRowVector.cc \
+FIXEDSOURCES = fixedColVector.cc fixedRowVector.cc \
        fixedMatrix.cc fixedComplex.cc fixedCColVector.cc fixedCRowVector.cc \
        fixedCMatrix.cc Array-f.cc fixed-conv.cc ov-fixed.cc ov-fixed-mat.cc \
        fixedNDArray.cc fixedCNDArray.cc \
@@ -41,47 +24,12 @@
        op-fcs-fs.cc  op-fcs-fm.cc  op-fcm-fs.cc  op-fcm-fm.cc \
        op-fcs-fcs.cc op-fcs-fcm.cc op-fcm-fcs.cc op-fcm-fcm.cc \
        fixed-var.cc fixed.cc
-  FIXEDOBJECTS = fixed-int.o $(patsubst %.cc,%.o,$(FIXEDSOURCES))
-  FIXEDDEPENDS = fixed-int.d $(patsubst %.cc,%.d,$(FIXEDSOURCES))
+FIXEDOBJECTS = fixed-int.o $(patsubst %.cc,%.o,$(FIXEDSOURCES))
+FIXEDDEPENDS = fixed-int.d $(patsubst %.cc,%.d,$(FIXEDSOURCES))
 
-  TARGETS = $(FIXEDTARGET)
-  OBJECTS = $(FIXEDOBJECTS)
+TARGETS = $(FIXEDTARGET)
+OBJECTS = $(FIXEDOBJECTS)
 
-  EXTRALIBS =
-else
-  FIXEDLIBTARGET = $(LIBPRE)octave_fixed.$(LIBEXT)
-  FIXEDIMPTARGET = $(FIXEDLIBTARGET:.$(LIBEXT)=.$(LIBIMPEXT))
-  FIXEDLIBSOURCES = fixedColVector.cc fixedRowVector.cc \
-       fixedMatrix.cc fixedComplex.cc fixedCColVector.cc fixedCRowVector.cc \
-       fixedCMatrix.cc Array-f.cc fixed-conv.cc ov-fixed.cc ov-fixed-mat.cc \
-       fixedNDArray.cc fixedCNDArray.cc \
-       ov-fixed-complex.cc ov-fixed-cx-mat.cc \
-       op-fs-fs.cc   op-fs-fm.cc   op-fm-fs.cc   op-fm-fm.cc \
-       op-fs-fcs.cc  op-fs-fcm.cc  op-fm-fcs.cc  op-fm-fcm.cc \
-       op-fcs-fs.cc  op-fcs-fm.cc  op-fcm-fs.cc  op-fcm-fm.cc \
-       op-fcs-fcs.cc op-fcs-fcm.cc op-fcm-fcs.cc op-fcm-fcm.cc
-  FIXEDLIBOBJECTS = fixed-int.o $(patsubst %.cc,%.o,$(FIXEDLIBSOURCES))
-  FIXEDLIBDEPENDS = fixed-int.d $(patsubst %.cc,%.d,$(FIXEDLIBSOURCES))
-
-  FIXEDSOURCES = fixed.cc fixed-var.cc
-  FIXEDOBJECTS = $(patsubst %.cc,%.o,$(FIXEDSOURCES))
-  FIXEDDEPENDS = $(FIXEDLIBDEPENDS) $(patsubst %.cc,%.d,$(FIXEDSOURCES))
-
-  TARGETS = $(FIXEDLIBTARGET) $(FIXEDTARGET)
-  OBJECTS = $(FIXEDLIBOBJECTS) $(FIXEDOBJECTS)
-
-  EXTRALIBS = -L./ -loctave_fixed
-
-  ifeq (1,$(ISMS))
-    # The name of this flag changed in version 2.1.54. Use both versions
-    # so that one of them will work.
-    MY_SH_LDFLAGS = $(shell $(MKOCTFILE) -p SH_LDFLAGS) \
-         -Wl,--out-implib=$(FIXEDIMPTARGET)
-    MY_DL_LDFLAGS = $(shell $(MKOCTFILE) -p DL_LDFLAGS) \
-         -Wl,--out-implib=$(FIXEDIMPTARGET)
-  endif
-endif
-
 ifeq ($(MAKECMDGOALS),all)
   DEPENDS = $(FIXEDDEPENDS)
 endif
@@ -89,11 +37,11 @@
   DEPENDS = $(FIXEDDEPENDS)
 endif
 
-DELETES = $(OBJECTS) $(FIXEDDEPENDS) $(TARGETS) $(FIXEDIMPTARGET) \
-       $(FIXEDVERTARGET) core octave-core *~ *.d-t int/fixed.o int/fixed.d \
+DELETES = $(OBJECTS) $(FIXEDDEPENDS) $(TARGETS) $(FIXEDVERTARGET) \
+       core octave-core *~ *.d-t int/fixed.o int/fixed.d \
        int/fixed.d-t FILES
 
-DEFINES = -DOCTAVE_FORGE
+DEFINES = -DOCTAVE_FORGE $(DLLDEF)
 MOFLAGS =
 
 .PHONY: all clean count
@@ -115,35 +63,11 @@
 install :
        @echo "Where exactly do you want me to install to!!!"
 else
-ifeq (1,$(OCT_INCLUDES_LIB))
 install : 
        @$(INSTALL) -d $(DESTDIR)$(MPATH)/fixed
 
 $(FIXEDOBJECTS) $(FIXEDDEPENDS): DEFINES := $(DEFINES) $(DLLDEF)
-else
-install : 
-       @$(INSTALL) -d $(DESTDIR)$(MPATH)/fixed; \
-       if test ! -e $(bindir)/$(LIBPRE)octave.$(LIBEXT) ; then \
-         echo "****** WARNING: $(FIXEDLIBTARGET) not correctly installed."; \
-         echo "****** To ensure correct operation $(FIXEDLIBTARGET) should"; \
-         echo "****** be in the same directory as $(LIBPRE)octave.$(LIBEXT)"; \
-       fi; \
-       $(INSTALL) $(FIXEDLIBTARGET) $(bindir); \
-       if test ! -e $(libdir)/$(LIBPRE)octave.$(LIBIMPEXT) ; then \
-         echo "****** WARNING: $(FIXEDIMPTARGET) not correctly installed"; \
-         echo "****** To ensure correct operation $(FIXEDIMPTARGET)"; \
-         echo "****** should be in the same directory as 
$(LIBPRE)octave.$(LIBIMPEXT)"; \
-       fi; \
-       $(INSTALL) $(FIXEDIMPTARGET) $(libdir);
-
-$(FIXEDLIBOBJECTS) $(FIXEDLIBDEPENDS): DEFINES := $(DEFINES) $(DLLDEF)
-
-$(FIXEDLIBTARGET): $(FIXEDLIBDEPENDS) $(FIXEDLIBOBJECTS) 
-       @echo "Linking $@"; \
-       $(RM) -f $@; \
-       DL_LDFLAGS="$(MY_DL_LDFLAGS)" SH_LDFLAGS="$(MY_SH_LDFLAGS)" 
$(MKOCTFILE) -v -o $@ $(FIXEDLIBOBJECTS)
 endif
-endif
 
 $(FIXEDTARGET) : $(DEPENDS) $(FIXEDOBJECTS) 
        @echo "Linking $@"; \
Index: main/fixed/examples/Makefile
===================================================================
--- main/fixed/examples/Makefile        (revision 4811)
+++ main/fixed/examples/Makefile        (working copy)
@@ -9,18 +9,6 @@
 INCLUDES = -I../src
 DEFINES = 
 
-ifeq (,$(findstring cygwin,$(canonical_host_type)))
- ifeq (,$(findstring mingw,$(canonical_host_type)))
-   ifneq (,$(findstring msdosmsvc,$(canonical_host_type)))
-    MOFLAGS = $(INCLUDES) -L../src -lfixed
-   else
-    MOFLAGS = $(INCLUDES)
-   endif
- else
-   MOFLAGS = $(INCLUDES) -L../ -loctave_fixed
- endif
-endif
-
 .PHONY: all clean count
 %.oct : %.cc 
 .SUFFIXES:
@@ -45,15 +33,15 @@
 
 %.oct: %.d %.o
        @echo "Linking $@"; \
-       $(MKOCTFILE) $(MOFLAGS) $(@:.oct=.o) -o $@
+       $(MKOCTFILE) $(@:.oct=.o) -o $@
 
 %.d: %.cc
        @echo "Depending $<"; \
-       $(MKOCTFILE) $(MOFLAGS) $(DEFINES) -M $<
+       $(MKOCTFILE) $(INCLUDES) $(DEFINES) -M $<
 
 %.o: %.cc
        @echo "Compiling $@"; \
-       $(MKOCTFILE) $(MOFLAGS) $(DEFINES) -c $< 
+       $(MKOCTFILE) $(INCLUDES) $(DEFINES) -c $< 
 
 clean:
        @echo "Cleaning..."; \
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to