octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MSVC compiler support [patch 11]: CRUFT.DLL exported symbols (Fortran)


From: Michael Goffioul
Subject: MSVC compiler support [patch 11]: CRUFT.DLL exported symbols (Fortran)
Date: Tue, 17 Oct 2006 21:47:26 +0200
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

To export symbols from the cruft DLL, I generate a .def file on the fly, while converting
fortran code to C code.

Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.526
diff -p -c -r1.526 configure.in
*** configure.in        13 Oct 2006 18:11:26 -0000      1.526
--- configure.in        17 Oct 2006 11:07:41 -0000
*************** elif $have_f2c; then
*** 699,708 ****
      AC_MSG_WARN($warn_f2c_no_lib)
    fi
    f77_rules_frag=Makefrag.f77
!   cat << \EOF > $f77_rules_frag
  
  %.c : %.f
!       $(F2C) $(F2CFLAGS) < $< > $(@F)
  
  %.o : %.f
  
--- 722,742 ----
      AC_MSG_WARN($warn_f2c_no_lib)
    fi
    f77_rules_frag=Makefrag.f77
!   f2c_rule_xtra=
!   case "$canonical_host_type" in
!     *-*-msdos)
!     f2c_rule_xtra="@grep -i -E -e '^      .*(SUBROUTINE|FUNCTION|ENTRY)' $< \
!         | sed -e 's/^      .*FUNCTION *\([[^ (]]*\).*\$\$/\1_/g' -e 's/^      
.*function *\([[^ (]]*\).*\$\$/\1_/g' \
!               -e 's/^      .*SUBROUTINE *\([[^ (]]*\).*\$\$/\1_/g' -e 's/^    
  .*subroutine *\([[^ (]]*\).*\$\$/\1_/g' \
!               -e 's/^      .*ENTRY *\([[^ (]]*\).*\$\$/\1_/g' -e 's/^      
.*entry *\([[^ (]]*\).*\$\$/\1_/g' \
!               -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' 
>> ../cruft.def"
!     ;;
!   esac
!   cat << EOF > $f77_rules_frag
  
  %.c : %.f
!       \$(F2C) \$(F2CFLAGS) < \$< > \$(@F)
!       $f2c_rule_xtra
  
  %.o : %.f
  
*************** else
*** 713,718 ****
--- 747,761 ----
    AC_MSG_ERROR([See the file INSTALL for more information.])
  fi
  
+ XTRA_CRUFT_LINK_DEPS=
+ case "$canonical_host_type" in
+   *-*-msdos)
+     FLIBS="$FLIBS -lkernel32"
+     XTRA_CRUFT_LINK_DEPS="-Wl,-def:cruft.def"
+   ;;
+ esac
+ AC_SUBST(XTRA_CRUFT_LINK_DEPS)
+ 
  FC=$F77
  AC_SUBST(FC)
  AC_SUBST_FILE(f77_rules_frag)
Index: libcruft/Makefile.in
===================================================================
RCS file: /cvs/octave/libcruft/Makefile.in,v
retrieving revision 1.93
diff -p -c -r1.93 Makefile.in
*** libcruft/Makefile.in        13 Oct 2006 18:11:26 -0000      1.93
--- libcruft/Makefile.in        17 Oct 2006 11:07:41 -0000
*************** CLEAN_SUBDIRS = $(DISTSUBDIRS)
*** 42,48 ****
  DISTFILES = Makefile.in ChangeLog Makerules.in $(SOURCES) STOP.patch
  
  # include BLAS and FFTW just in case some of libcruft depends on them
! LINK_DEPS = $(BLAS_LIBS) $(FFTW_LIBS) $(FLIBS)
  
  all: libraries
  .PHONY: all
--- 42,49 ----
  DISTFILES = Makefile.in ChangeLog Makerules.in $(SOURCES) STOP.patch
  
  # include BLAS and FFTW just in case some of libcruft depends on them
! XTRA_CRUFT_LINK_DEPS = @XTRA_CRUFT_LINK_DEPS@
! LINK_DEPS = $(BLAS_LIBS) $(FFTW_LIBS) $(FLIBS) $(XTRA_CRUFT_LINK_DEPS)
  
  all: libraries
  .PHONY: all
*************** else
*** 87,93 ****
    endif
  endif
  
! libraries: $(SUBDIRS)
        $(MAKE) $(LIBRARIES)
  .PHONY: libraries
  
--- 88,99 ----
    endif
  endif
  
! cruft.def:
!       if ! test -f "$@"; then \
!         echo "EXPORTS" > $@ ; \
!       fi
! 
! libraries: cruft.def $(SUBDIRS)
        $(MAKE) $(LIBRARIES)
  .PHONY: libraries
  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]