# HG changeset patch # User Michael Goffioul # Date 1371833962 14400 # Node ID a46b4b6fc26f3caffb1c724cbc55d620d2037b9d # Parent 050e922d4003718628f9ef69e35eb00c49dfcc0a [MSVC] enable ARPACK compilation diff -r 050e922d4003 -r a46b4b6fc26f src/arpack.mk --- a/src/arpack.mk Fri Jun 21 11:43:05 2013 -0400 +++ b/src/arpack.mk Fri Jun 21 12:59:22 2013 -0400 @@ -43,7 +43,7 @@ $($(PKG)_CONFIGURE_PIC_OPTION) \ $($(PKG)_BLAS_OPTION) \ --prefix='$(HOST_PREFIX)' \ - $($(PKG)_ENABLE_64_CONFIGURE_OPTIONS) + $($(PKG)_ENABLE_64_CONFIGURE_OPTIONS) && $(CONFIGURE_POST_HOOK) $(MAKE) -C '$(1)/.build' -j '$(JOBS)' if [ $(BUILD_STATIC) = yes ]; then \ diff -r 050e922d4003 -r a46b4b6fc26f tools/make-shared-from-static --- a/tools/make-shared-from-static Fri Jun 21 11:43:05 2013 -0400 +++ b/tools/make-shared-from-static Fri Jun 21 12:59:22 2013 -0400 @@ -12,6 +12,7 @@ install=false windowsdll=false msvc=false +msvclibmode=false libprefix= libsuffix= LIBS= @@ -133,6 +134,15 @@ base_name=`echo $base_infile | sed -n -e 's/^lib\(.*\)\.a$/\1/p'` outfile="${libprefix}${base_name}${libsuffix}.dll" implibfile="$base_name.lib" + # Modern libtool won't create .a files, but will create directly .lib files. + # If the .a file does not exist, check for an existing .lib file. + if [ ! -f "$infile" ]; then + msvc_infile=`echo $infile | sed -e 's/\.a$/.lib/'` + if [ -f "$msvc_infile" ]; then + infile="$msvc_infile" + msvclibmode=true + fi + fi else outfile=$(echo $base_infile | sed 's/\.a$/.dll/') implibfile="$outfile.a" @@ -159,7 +169,7 @@ ( cd $tmpdir - $AR x $infile + $msvclibmode || $AR x $infile LIBDIR_ARGS= if [ -n "$libdir" ]; then @@ -170,15 +180,19 @@ if $msvc; then export_symbols="$base_name.def" echo EXPORTS > $export_symbols - libobjs="*.o" + if $msvclibmode; then + libobjs="$infile" + else + libobjs="*.o" + fi convenience= eval cmd=\"$export_symbols_cmds\" eval "$cmd" - link_args="-Wl,-def:$export_symbols" + link_args="-Wl,-def:$export_symbols $libobjs" else - link_args="-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base" + link_args="-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base *.o" fi - $LD -shared $link_args -Wl,--out-implib="$implibfile" -o "$outfile" *.o $LIBDIR_ARGS $LIBS + $LD -shared $link_args -Wl,--out-implib="$implibfile" -o "$outfile" $LIBDIR_ARGS $LIBS else $LD -shared -o $outfile *.o $LIBDIR_ARGS $LIBS fi