File gpc-20070904-shared.patch of Package gcc3

diff -Ndurp p/Make-lang.in p-shared/Make-lang.in
--- p/Make-lang.in	2007-09-04 09:53:20.000000000 +0300
+++ p-shared/Make-lang.in	2014-09-29 18:51:18.762331816 +0300
@@ -138,7 +138,7 @@ rts_version=`cat $(RTS_VERSION_FILENAME)
 GPCSOLIBSHORTNAME=libgpc.so
 GPCSOLIBNAME=$(GPCSOLIBSHORTNAME).$(gpc_major).$(gpc_minor).$(rts_version)
 GPCSOLIBDIR=lib
-WITH_SHARED=@with_shared@
+ENABLE_SHARED=@enable_shared@
 
 BISON=bison
 BISONFLAGS=
@@ -208,7 +208,7 @@ GPC_INSTALL_FLAGS_TO_PASS=\
   "GPCSOLIBSHORTNAME=$(GPCSOLIBSHORTNAME)" \
   "GPCSOLIBDIR=$(GPCSOLIBDIR)" \
   "GPC_EXTRA_INSTALL_LIBS=$(GPC_EXTRA_INSTALL_LIBS)" \
-  "WITH_SHARED=$(WITH_SHARED)" \
+  "ENABLE_SHARED=$(ENABLE_SHARED)" \
   "FLOAT_H=$(FLOAT_H)" \
   "EXTRA_PARTS=$(EXTRA_PARTS)" \
   $(GPC_EXTRA_INSTALL_FLAGS_TO_PASS)
@@ -783,7 +783,7 @@ p/rts/Makefile: $(GCC_PARTS) \
 	cd ./p/rts && \
 	$(RTS_COMPILERS) CONFIG_SITE=nonexisting-file \
 	$$src/p/rts/configure --silent > /dev/null --srcdir=$$src/p/rts \
-	 `if [ x$(WITH_SHARED) = xyes ]; then echo '--with-shared'; fi`
+	 `if [ x$(ENABLE_SHARED) = xyes ]; then echo '--enable-shared'; fi`
 
 pascal.rts: p/rts/Makefile xgpc$(exeext) gpc1$(exeext)
 	cd ./p/rts && $(MAKE) $(RTS_COMPILERS) $(RTS_FLAGS_TO_PASS) all
@@ -962,7 +962,7 @@ pascal.install-lib: pascal.install-dir p
 	    $(INSTALL_DATA) "$$f" "$(DESTDIR)$(libsubdir)/`echo "$$f" | sed -e 's,.*/,,'`" || exit 1; \
 	  fi; \
 	done
-	if [ x$(WITH_SHARED) = xyes ] && [ -f $(GPCSOLIBNAME) ]; then \
+	if [ x$(ENABLE_SHARED) = xyes ] && [ -f $(GPCSOLIBNAME) ]; then \
 	  $(srcdir)/p/script/mkdir-p -m a+rx $(DESTDIR)$(prefix)/$(GPCSOLIBDIR) && \
 	  rm -f $(DESTDIR)$(libsubdir)/$(GPCSOLIBSHORTNAME) $(DESTDIR)$(prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME); \
 	  $(INSTALL_DATA) $(GPCSOLIBNAME) $(DESTDIR)$(prefix)/$(GPCSOLIBDIR)/$(GPCSOLIBNAME) && \
diff -Ndurp p/rts/configure p-shared/rts/configure
--- p/rts/configure	2007-09-04 09:22:54.000000000 +0300
+++ p-shared/rts/configure	2014-09-29 18:50:25.043919007 +0300
@@ -12,7 +12,7 @@ ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
 ac_help="$ac_help
-  --with-shared           build shared RTS library"
+  --enable-shared         build shared RTS library"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -789,12 +789,27 @@ fi
 fi
 
 
-# Check whether --with-shared or --without-shared was given.
-if test "${with_shared+set}" = set; then
-  withval="$with_shared"
-  with_shared=${withval}
-fi
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
 
+  case $enable_shared in
+  yes | no) ;;
+  *)
+    enable_shared=no
+    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+    for pkg in $enableval; do
+      if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
+        enable_shared=yes
+      fi
+    done
+    IFS="$ac_save_ifs"
+    ;;
+  esac
+
+else
+  enable_shared=yes
+fi;
 
 
 # GPC_DEFINE(NAME)
@@ -4025,7 +4040,7 @@ s%@CC@%$CC%g
 s%@AR@%$AR%g
 s%@RANLIB@%$RANLIB%g
 s%@RANLIB_TEST@%$RANLIB_TEST%g
-s%@with_shared@%$with_shared%g
+s%@enable_shared@%$enable_shared%g
 s%@CPP@%$CPP%g
 
 CEOF
diff -Ndurp p/rts/configure.in p-shared/rts/configure.in
--- p/rts/configure.in	2007-09-04 09:22:54.000000000 +0300
+++ p-shared/rts/configure.in	2014-09-29 18:50:25.043919007 +0300
@@ -44,8 +44,24 @@ else
 fi
 AC_SUBST(RANLIB_TEST)
 
-AC_ARG_WITH(shared, [  --with-shared           build shared RTS library], with_shared=${withval})
-AC_SUBST(with_shared)
+AC_ARG_ENABLE(shared,
+[  --enable-shared         build shared RTS library],
+[
+  case $enable_shared in
+  yes | no) ;;
+  *)
+    enable_shared=no
+    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+    for pkg in $enableval; do
+      if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
+        enable_shared=yes
+      fi
+    done
+    IFS="$ac_save_ifs"
+    ;;
+  esac
+], [enable_shared=yes])
+AC_SUBST(enable_shared)
 
 # GPC_DEFINE(NAME)
 # Define $1 in upper case
diff -Ndurp p/rts/Makefile.in p-shared/rts/Makefile.in
--- p/rts/Makefile.in	2007-09-04 09:22:54.000000000 +0300
+++ p-shared/rts/Makefile.in	2014-09-29 18:50:57.449565376 +0300
@@ -45,7 +45,7 @@ RTSFLAGS=
 DESTDIR=.
 GCC_VERSION=unknown
 
-WITH_SHARED=@with_shared@
+ENABLE_SHARED=@enable_shared@
 VERSION_FILENAME=$(srcdir)/rts-version
 gpc_major=2
 gpc_minor=1
@@ -57,7 +57,7 @@ GPCSOLIB=$(DESTDIR)/$(GPCSOLIBNAME)
 ifdef TARGET_MACHO
        GPCSOLIBOPTIONS = -dynamiclib -dylib_install_name,$(GPCSOLIBNAME)
 else
-       GPCSOLIBOPTIONS = -shared -Wl,-soname=$(GPCSOLIBNAME)
+       GPCSOLIBOPTIONS = -shared -Wl,-soname=$(GPCSOLIBSHORTNAME).$(gpc_major)
 endif
 PFLAGS1=--unit-path=$(VPATH) --automake
 RTS_WARN=-W -Wall -Wmissing-prototypes -Wmissing-declarations
@@ -83,7 +83,7 @@ GENERATED_FILES=\
  $(srcdir)/rtsc.pas \
  $(srcdir)/gpc.pas
 
-all: $(GPCLIB) sharedlib.$(WITH_SHARED)
+all: $(GPCLIB) sharedlib.$(ENABLE_SHARED)
 
 generated-files: $(GENERATED_FILES)
 
@@ -112,12 +112,8 @@ rts-config.inc: rts-config.h
 	echo '{ rts-config.inc.  Generated automatically from rts-config.h.  }' > rts-config.inc
 	sed -e 's,/\*,{,g;s,\*/,},g;s,^[ \t]*#\(.*\),{$$\1},' rts-config.h >> rts-config.inc
 
-# @@ `with_shared' is currently not substituted in the parent Makefile, so
-#    it arrives here via the setting of $(WITH_SHARED) on the command line
-DUMMY=# Don't let configure substitute `@with_shared$(DUMMY)@' below
-
 .PHONY: all install check generated-files rts.update-release \
-        sharedlib. sharedlib.no sharedlib.@with_shared$(DUMMY)@ sharedlib.yes \
+        sharedlib. sharedlib.no sharedlib.@enable_shared@ sharedlib.yes \
         mostlyclean clean distclean extraclean maintainer-clean
 
 install:
@@ -127,7 +123,7 @@ install:
 	@echo "if know what you are doing and have a current GPC version installed," >&2
 	@echo "but you will have to install the resulting file(s) (libgpc.*) manually" >&2
 	@echo "into the right directories, and create a symlink for the shared library" >&2
-	@echo "if configured \`--with-shared'." >&2
+	@echo "if configured \`--enable-shared'." >&2
 
 check:
 	@echo "Checks for the GPC RTS are contained in the GPC Test Suite."
@@ -190,7 +186,7 @@ $(GPCLIB): $(OBJS)
 	-$(RANLIB) $(GPCLIB) 2> /dev/null
 
 # That's a way to do an `if' that even a stupid make understands ...
-sharedlib. sharedlib.no sharedlib.@with_shared$(DUMMY)@:
+sharedlib. sharedlib.no sharedlib.@enable_shared@:
 sharedlib.yes: $(GPCSOLIB)
 $(GPCSOLIB): $(SO_OBJS)
 	-rm -f $(GPCSOLIB)
openSUSE Build Service is sponsored by