Alexandre Julliard : makefiles: Build import libraries that contain object files as static libraries.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 25 10:00:38 CDT 2016


Module: wine
Branch: master
Commit: 27528e54980d2742ff9b32ce2dbd5f8b73ba63b2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=27528e54980d2742ff9b32ce2dbd5f8b73ba63b2

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Mar 25 15:31:54 2016 +0900

makefiles: Build import libraries that contain object files as static libraries.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 aclocal.m4      | 25 +++++++------------------
 configure       | 27 +++++++--------------------
 configure.ac    |  2 --
 tools/makedep.c | 24 +++++-------------------
 4 files changed, 19 insertions(+), 59 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 41eb7f6..c65ebc4 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -395,29 +395,18 @@ $ac_dir/uninstall::
     if wine_fn_has_flag staticimplib
     then
         wine_fn_append_rule \
-"__builddeps__: $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT
-$ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: $ac_deps
-$ac_file.def: $srcdir/$ac_dir/$ac_name.spec \$(WINEBUILD)
-	\$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --def -o \$[@] --export $srcdir/$ac_dir/$ac_name.spec
-$ac_file.$STATIC_IMPLIBEXT: dummy
-	@cd $ac_dir && \$(MAKE) lib$ac_implib.$STATIC_IMPLIBEXT
+"__builddeps__: $ac_file.a
+$ac_file.a $ac_file.cross.a: $ac_deps
+$ac_file.a: dummy
+	@cd $ac_dir && \$(MAKE) lib$ac_implib.a
 .PHONY: $ac_dir/install-dev $ac_dir/uninstall
-$ac_dir/install-dev:: $ac_file.$IMPLIBEXT
-	\$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
+$ac_dir/install-dev:: $ac_file.a
+	\$(INSTALL_DATA) $ac_file.a \$(DESTDIR)\$(dlldir)/lib$ac_implib.a
 $ac_dir/uninstall::
-	\$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
+	\$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.a
 install install-dev:: $ac_dir/install-dev
 __uninstall__: $ac_dir/uninstall"
 
-        if test "$IMPLIBEXT" != "$STATIC_IMPLIBEXT"
-        then
-            wine_fn_append_rule \
-"$ac_dir/install-dev:: $ac_file.$STATIC_IMPLIBEXT __builddeps__
-	\$(INSTALL_DATA) $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT
-$ac_dir/uninstall::
-	\$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT"
-        fi
-
         if test -n "$CROSSTARGET" -a -z "$ac_implibflags"
         then
             wine_fn_append_rule \
diff --git a/configure b/configure
index 76a6267..4d39f05 100755
--- a/configure
+++ b/configure
@@ -7184,7 +7184,6 @@ LDEXECFLAGS=""
 LIBEXT="so"
 DLLEXT=".so"
 IMPLIBEXT="def"
-STATIC_IMPLIBEXT="def.a"
 # Extract the first word of "ldd", so it can be a program name with args.
 set dummy ldd; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7622,29 +7621,18 @@ fi
     if wine_fn_has_flag staticimplib
     then
         wine_fn_append_rule \
-"__builddeps__: $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT
-$ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: $ac_deps
-$ac_file.def: $srcdir/$ac_dir/$ac_name.spec \$(WINEBUILD)
-	\$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --def -o \$@ --export $srcdir/$ac_dir/$ac_name.spec
-$ac_file.$STATIC_IMPLIBEXT: dummy
-	@cd $ac_dir && \$(MAKE) lib$ac_implib.$STATIC_IMPLIBEXT
+"__builddeps__: $ac_file.a
+$ac_file.a $ac_file.cross.a: $ac_deps
+$ac_file.a: dummy
+	@cd $ac_dir && \$(MAKE) lib$ac_implib.a
 .PHONY: $ac_dir/install-dev $ac_dir/uninstall
-$ac_dir/install-dev:: $ac_file.$IMPLIBEXT
-	\$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
+$ac_dir/install-dev:: $ac_file.a
+	\$(INSTALL_DATA) $ac_file.a \$(DESTDIR)\$(dlldir)/lib$ac_implib.a
 $ac_dir/uninstall::
-	\$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT
+	\$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.a
 install install-dev:: $ac_dir/install-dev
 __uninstall__: $ac_dir/uninstall"
 
-        if test "$IMPLIBEXT" != "$STATIC_IMPLIBEXT"
-        then
-            wine_fn_append_rule \
-"$ac_dir/install-dev:: $ac_file.$STATIC_IMPLIBEXT __builddeps__
-	\$(INSTALL_DATA) $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT
-$ac_dir/uninstall::
-	\$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT"
-        fi
-
         if test -n "$CROSSTARGET" -a -z "$ac_implibflags"
         then
             wine_fn_append_rule \
@@ -7921,7 +7909,6 @@ fi
     LIBEXT="dll"
     DLLEXT=""
     IMPLIBEXT="a"
-    STATIC_IMPLIBEXT="a"
         enable_iphlpapi=${enable_iphlpapi:-no}
     enable_kernel32=${enable_kernel32:-no}
     enable_msvcrt=${enable_msvcrt:-no}
diff --git a/configure.ac b/configure.ac
index 8c22a4f..ddb28fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -676,7 +676,6 @@ AC_SUBST(LDEXECFLAGS,"")
 LIBEXT="so"
 DLLEXT=".so"
 IMPLIBEXT="def"
-STATIC_IMPLIBEXT="def.a"
 WINE_PATH_SONAME_TOOLS
 WINE_CONFIG_HELPERS
 
@@ -691,7 +690,6 @@ case $host_os in
     LIBEXT="dll"
     DLLEXT=""
     IMPLIBEXT="a"
-    STATIC_IMPLIBEXT="a"
     dnl Disable modules that can't be used on Windows
     enable_iphlpapi=${enable_iphlpapi:-no}
     enable_kernel32=${enable_kernel32:-no}
diff --git a/tools/makedep.c b/tools/makedep.c
index 9ee316c..7f81208 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1810,7 +1810,7 @@ static void add_generated_sources( struct makefile *make )
         if (source->file->flags & FLAG_C_IMPLIB)
         {
             if (!make->staticimplib && make->importlib && *dll_ext)
-                make->staticimplib = strmake( "lib%s.def.a", make->importlib );
+                make->staticimplib = strmake( "lib%s.a", make->importlib );
         }
         if (strendswith( source->name, ".po" ))
         {
@@ -2004,9 +2004,10 @@ static struct strarray add_import_libs( const struct makefile *make, struct stra
                 const char *dir = top_obj_dir_path( make, submake->base_dir );
                 const char *ext = cross ? "cross.a" : *dll_ext ? "def" : "a";
 
-                strarray_add( deps, strmake( "%s/lib%s.%s", dir, name, ext ));
                 if (!cross && submake->staticimplib)
-                    strarray_add( deps, strmake( "%s/%s", dir, submake->staticimplib ));
+                    lib = base_dir_path( submake, submake->staticimplib );
+                else
+                    strarray_add( deps, strmake( "%s/lib%s.%s", dir, name, ext ));
                 break;
             }
 
@@ -2704,7 +2705,7 @@ static struct strarray output_sources( const struct makefile *make )
         if (spec_file && make->importlib)
         {
             char *importlib_path = obj_dir_path( make, strmake( "lib%s", make->importlib ));
-            if (*dll_ext)
+            if (*dll_ext && !implib_objs.count)
             {
                 strarray_add( &clean_files, strmake( "lib%s.def", make->importlib ));
                 output( "%s.def: %s %s\n", importlib_path, tools_path( make, "winebuild" ), spec_file );
@@ -2715,21 +2716,6 @@ static struct strarray output_sources( const struct makefile *make )
                 add_install_rule( make, install_rules, make->importlib,
                                   strmake( "lib%s.def", make->importlib ),
                                   strmake( "d$(dlldir)/lib%s.def", make->importlib ));
-                if (implib_objs.count)
-                {
-                    strarray_add( &clean_files, strmake( "lib%s.def.a", make->importlib ));
-                    output( "%s.def.a:", importlib_path );
-                    output_filenames_obj_dir( make, implib_objs );
-                    output( "\n" );
-                    output( "\trm -f $@\n" );
-                    output( "\t$(AR) $(ARFLAGS) $@" );
-                    output_filenames_obj_dir( make, implib_objs );
-                    output( "\n" );
-                    output( "\t$(RANLIB) $@\n" );
-                    add_install_rule( make, install_rules, make->importlib,
-                                      strmake( "lib%s.def.a", make->importlib ),
-                                      strmake( "d$(dlldir)/lib%s.def.a", make->importlib ));
-                }
             }
             else
             {




More information about the wine-cvs mailing list