Bug 648134 - [OS/2] follow-up Stop building intermediate static libs with fakelibs. r=glandium
authorWalter Meinl <wuno@lsvw.de>
Fri, 05 Aug 2011 00:16:00 -0400
changeset 74171 b6dfc500248d10f830e418238a934d8f69e80820
parent 74170 a7f8e93c6e22877df79d0d3d3432ac65afb9c7ed
child 74172 682ad2a5f003b837db3d3abd2eedea2010a35a51
child 74176 ed2631aec9d425e8bc0c5517bcc5c8e7323eb828
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersglandium
bugs648134
milestone8.0a1
Bug 648134 - [OS/2] follow-up Stop building intermediate static libs with fakelibs. r=glandium
config/expandlibs_exec.py
config/rules.mk
configure.in
js/src/Makefile.in
js/src/config/expandlibs_exec.py
js/src/config/rules.mk
js/src/configure.in
--- a/config/expandlibs_exec.py
+++ b/config/expandlibs_exec.py
@@ -110,16 +110,17 @@ class ExpandArgsMore(ExpandArgs):
         fd, tmp = tempfile.mkstemp(suffix=".list",dir=os.curdir)
         if conf.EXPAND_LIBS_LIST_STYLE == "linkerscript":
             content = ["INPUT(%s)\n" % obj for obj in objs]
             ref = tmp
         elif conf.EXPAND_LIBS_LIST_STYLE == "list":
             content = ["%s\n" % obj for obj in objs]
             ref = "@" + tmp
         else:
+            os.close(fd)
             os.remove(tmp)
             return
         self.tmp.append(tmp)
         f = os.fdopen(fd, "w")
         f.writelines(content)
         f.close()
         idx = self.index(objs[0])
         newlist = self[0:idx] + [ref] + [item for item in self[idx:] if item not in objs]
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1091,17 +1091,17 @@ endif
 $(filter-out %.$(LIB_SUFFIX),$(LIBRARY)): $(filter %.$(LIB_SUFFIX),$(LIBRARY)) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
 	$(EXPAND_LIBS_GEN) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) > $@
 
 ifeq ($(OS_ARCH),WINNT)
 $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
 endif
 
 ifeq ($(OS_ARCH),OS2)
-$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
+$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS_DEPS)
 	$(RM) $@
 	echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
 	echo PROTMODE >> $@
 	echo CODE    LOADONCALL MOVEABLE DISCARDABLE >> $@
 	echo DATA    PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
 	echo EXPORTS >> $@
 
 	$(ADD_TO_DEF_FILE)
--- a/configure.in
+++ b/configure.in
@@ -2515,16 +2515,17 @@ ia64*-hpux*)
     LIB_PREFIX=
     LIB_SUFFIX=lib
     BIN_SUFFIX=".exe"
     DLL_SUFFIX=".dll"
     IMPORT_LIB_SUFFIX=lib
     DSO_PIC_CFLAGS=
     AR=emxomfar
     AR_FLAGS='r $@'
+    AR_EXTRACT=
     CFLAGS="$CFLAGS -Zomf"
     CXXFLAGS="$CXXFLAGS -Zomf"
     DSO_LDOPTS='-Zdll'
     BIN_FLAGS='-Zlinker /ST:0x100000'
     IMPLIB='emximp -o'
     FILTER='true'
     LDFLAGS='-Zmap'
     WARNINGS_AS_ERRORS='-Werror'
@@ -8121,21 +8122,21 @@ dnl = linker
 dnl =
 dnl ========================================================
 
 AC_CACHE_CHECK(what kind of list files are supported by the linker,
     EXPAND_LIBS_LIST_STYLE,
     [echo "int main() {return 0;}" > conftest.${ac_ext}
      if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&2) && test -s conftest.${OBJ_SUFFIX}; then
          echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
-         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
+         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $LDFLAGS conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
              EXPAND_LIBS_LIST_STYLE=linkerscript
          else
              echo "conftest.${OBJ_SUFFIX}" > conftest.list
-             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
+             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $LDFLAGS @conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
                  EXPAND_LIBS_LIST_STYLE=list
              else
                  EXPAND_LIBS_LIST_STYLE=none
              fi
          fi
      else
          dnl We really don't expect to get here, but just in case
          AC_ERROR([couldn't compile a simple C file])
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -498,18 +498,23 @@ LOCAL_INCLUDES += \
     -I. \
     $(NULL)
 
 
 ifdef MOZ_NATIVE_FFI
 EXTRA_DSO_LDOPTS += $(MOZ_FFI_LIBS)
 else
 ifeq ($(OS_ARCH),OS2)
+libs:: ctypes/libffi/.libs/ffi.$(LIB_SUFFIX)
+
+ctypes/libffi/.libs/ffi.$(LIB_SUFFIX): ctypes/libffi/.libs/$(LIB_PREFIX)ffi.a
+	emxomf $<
+
 SHARED_LIBRARY_LIBS += \
-    ctypes/libffi/.libs/ffi.a \
+    ctypes/libffi/.libs/ffi.$(LIB_SUFFIX) \
     $(NULL)
 else
 SHARED_LIBRARY_LIBS += \
     ctypes/libffi/.libs/libffi.$(LIB_SUFFIX) \
     $(NULL)
 endif
 endif
 
--- a/js/src/config/expandlibs_exec.py
+++ b/js/src/config/expandlibs_exec.py
@@ -110,16 +110,17 @@ class ExpandArgsMore(ExpandArgs):
         fd, tmp = tempfile.mkstemp(suffix=".list",dir=os.curdir)
         if conf.EXPAND_LIBS_LIST_STYLE == "linkerscript":
             content = ["INPUT(%s)\n" % obj for obj in objs]
             ref = tmp
         elif conf.EXPAND_LIBS_LIST_STYLE == "list":
             content = ["%s\n" % obj for obj in objs]
             ref = "@" + tmp
         else:
+            os.close(fd)
             os.remove(tmp)
             return
         self.tmp.append(tmp)
         f = os.fdopen(fd, "w")
         f.writelines(content)
         f.close()
         idx = self.index(objs[0])
         newlist = self[0:idx] + [ref] + [item for item in self[idx:] if item not in objs]
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -1091,17 +1091,17 @@ endif
 $(filter-out %.$(LIB_SUFFIX),$(LIBRARY)): $(filter %.$(LIB_SUFFIX),$(LIBRARY)) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
 	$(EXPAND_LIBS_GEN) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) > $@
 
 ifeq ($(OS_ARCH),WINNT)
 $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
 endif
 
 ifeq ($(OS_ARCH),OS2)
-$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS)
+$(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS_DEPS)
 	$(RM) $@
 	echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@
 	echo PROTMODE >> $@
 	echo CODE    LOADONCALL MOVEABLE DISCARDABLE >> $@
 	echo DATA    PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
 	echo EXPORTS >> $@
 
 	$(ADD_TO_DEF_FILE)
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -2432,16 +2432,17 @@ ia64*-hpux*)
     LIB_PREFIX=
     LIB_SUFFIX=lib
     BIN_SUFFIX=".exe"
     DLL_SUFFIX=".dll"
     IMPORT_LIB_SUFFIX=lib
     DSO_PIC_CFLAGS=
     AR=emxomfar
     AR_FLAGS='r $@'
+    AR_EXTRACT=
     CFLAGS="$CFLAGS -Zomf"
     CXXFLAGS="$CXXFLAGS -Zomf"
     DSO_LDOPTS='-Zdll'
     BIN_FLAGS='-Zlinker /ST:0x100000'
     IMPLIB='emximp -o'
     FILTER='true'
     LDFLAGS='-Zmap'
     WARNINGS_AS_ERRORS='-Werror'
@@ -5363,21 +5364,21 @@ dnl = linker
 dnl =
 dnl ========================================================
 
 AC_CACHE_CHECK(what kind of list files are supported by the linker,
     EXPAND_LIBS_LIST_STYLE,
     [echo "int main() {return 0;}" > conftest.${ac_ext}
      if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&2) && test -s conftest.${OBJ_SUFFIX}; then
          echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
-         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
+         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $LDFLAGS conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
              EXPAND_LIBS_LIST_STYLE=linkerscript
          else
              echo "conftest.${OBJ_SUFFIX}" > conftest.list
-             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
+             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $LDFLAGS @conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
                  EXPAND_LIBS_LIST_STYLE=list
              else
                  EXPAND_LIBS_LIST_STYLE=none
              fi
          fi
      else
          dnl We really don't expect to get here, but just in case
          AC_ERROR([couldn't compile a simple C file])
@@ -5975,17 +5976,17 @@ if test "$JS_HAS_CTYPES" -a -z "$MOZ_NAT
     # Always use gcc for libffi on IBM AIX5/AIX6
     if test ! "$HAVE_64BIT_OS"; then
       ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix32"
     else
       ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix64"
     fi
   fi
   if test "$OS_ARCH" = "OS2"; then
-    ac_configure_args="$ac_configure_args CFLAGS=-Zomf AR=emxomfar"
+    ac_configure_args="$ac_configure_args AR=ar"
   fi
 
   # Use a separate cache file for libffi, since it does things differently
   # from our configure.
   mkdir -p $_objdir/ctypes/libffi
   old_cache_file=$cache_file
   cache_file=$_objdir/ctypes/libffi/config.cache
   old_config_files=$CONFIG_FILES