File ocaml-rpmoptflags.patch of Package ocaml

Index: ocaml-4.00.1/asmrun/Makefile
===================================================================
--- ocaml-4.00.1.orig/asmrun/Makefile
+++ ocaml-4.00.1/asmrun/Makefile
@@ -18,9 +18,9 @@ include ../config/Makefile
 CC=$(NATIVECC)
 FLAGS=-I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE \
       -DTARGET_$(ARCH) -DSYS_$(SYSTEM) $(IFLEXDIR)
-CFLAGS=$(FLAGS) -O $(NATIVECCCOMPOPTS)
+CFLAGS=$(FLAGS) $(RPM_OPT_FLAGS) -O $(NATIVECCCOMPOPTS)
 DFLAGS=$(FLAGS) -g -DDEBUG $(NATIVECCCOMPOPTS)
-PFLAGS=$(FLAGS) -pg -O -DPROFILING $(NATIVECCPROFOPTS)
+PFLAGS=$(FLAGS) $(RPM_OPT_FLAGS) -pg -O -DPROFILING $(NATIVECCPROFOPTS)
 
 COBJS=startup.o main.o fail.o roots.o globroots.o signals.o signals_asm.o \
   misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o \
Index: ocaml-4.00.1/configure
===================================================================
--- ocaml-4.00.1.orig/configure
+++ ocaml-4.00.1/configure
@@ -347,7 +347,7 @@ esac
 
 # Configure compiler to use in further tests
 
-cc="$bytecc -O $bytecclinkopts"
+cc="$bytecc $RPM_OPT_FLAGS $bytecclinkopts"
 export cc cclibs verbose
 
 # Check C compiler
Index: ocaml-4.00.1/otherlibs/Makefile
===================================================================
--- ocaml-4.00.1.orig/otherlibs/Makefile
+++ ocaml-4.00.1/otherlibs/Makefile
@@ -17,7 +17,7 @@
 
 CAMLC=$(ROOTDIR)/ocamlcomp.sh
 CAMLOPT=$(ROOTDIR)/ocamlcompopt.sh
-CFLAGS=-I$(ROOTDIR)/byterun -O $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
+CFLAGS=$(RPM_OPT_FLAGS) -I$(ROOTDIR)/byterun -O $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS)
 
 include ../Makefile.shared
 # Note .. is the current directory (this makefile is included from
Index: ocaml-4.00.1/otherlibs/labltk/support/Makefile
===================================================================
--- ocaml-4.00.1.orig/otherlibs/labltk/support/Makefile
+++ ocaml-4.00.1/otherlibs/labltk/support/Makefile
@@ -28,7 +28,7 @@ COBJS=cltkCaml.$(O) cltkUtf.$(O) cltkEva
       cltkFile.$(O) cltkMain.$(O) cltkMisc.$(O) cltkTimer.$(O) \
       cltkVar.$(O) cltkWait.$(O) cltkImg.$(O)
 
-CCFLAGS=-I../../../byterun $(TK_DEFS) $(SHAREDCCCOMPOPTS)
+CCFLAGS=$(RPM_OPT_FLAGS) -I../../../byterun $(TK_DEFS) $(SHAREDCCCOMPOPTS)
 
 COMPFLAGS=-I $(OTHERS)/win32unix -I $(OTHERS)/unix
 THFLAGS=-I $(OTHERS)/systhreads -I $(OTHERS)/threads
Index: ocaml-4.00.1/otherlibs/systhreads/Makefile
===================================================================
--- ocaml-4.00.1.orig/otherlibs/systhreads/Makefile
+++ ocaml-4.00.1/otherlibs/systhreads/Makefile
@@ -33,7 +33,7 @@ libthreads.a: $(BYTECODE_C_OBJS)
 	$(MKLIB) -o threads $(BYTECODE_C_OBJS) -lpthread
 
 st_stubs_b.o: st_stubs.c st_posix.h
-	$(BYTECC) -O -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
+	$(BYTECC) $(RPM_OPT_FLAGS) -O -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \
 	   -c st_stubs.c
 	mv st_stubs.o st_stubs_b.o
 
@@ -43,7 +43,7 @@ libthreadsnat.a: $(NATIVECODE_C_OBJS)
 	$(AR) rc libthreadsnat.a $(NATIVECODE_C_OBJS)
 
 st_stubs_n.o: st_stubs.c st_posix.h
-	$(NATIVECC) -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c st_stubs.c
+	$(NATIVECC) $(RPM_OPT_FLAGS) -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c st_stubs.c
 	mv st_stubs.o st_stubs_n.o
 
 threads.cma: $(THREAD_OBJS)
Index: ocaml-4.00.1/otherlibs/threads/Makefile
===================================================================
--- ocaml-4.00.1.orig/otherlibs/threads/Makefile
+++ ocaml-4.00.1/otherlibs/threads/Makefile
@@ -16,7 +16,7 @@
 include ../../config/Makefile
 
 CC=$(BYTECC)
-CFLAGS=-I../../byterun -O $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
+CFLAGS=-I../../byterun $(RPM_OPT_FLAGS) $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -g
 CAMLC=../../ocamlcomp.sh -I ../unix
 MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib
 COMPFLAGS=-warn-error A
Index: ocaml-4.00.1/yacc/Makefile
===================================================================
--- ocaml-4.00.1.orig/yacc/Makefile
+++ ocaml-4.00.1/yacc/Makefile
@@ -17,7 +17,7 @@
 include ../config/Makefile
 
 CC=$(BYTECC)
-CFLAGS=-O -DNDEBUG $(BYTECCCOMPOPTS)
+CFLAGS=$(RPM_OPT_FLAGS) -DNDEBUG $(BYTECCCOMPOPTS)
 
 OBJS= closure.o error.o lalr.o lr0.o main.o mkpar.o output.o reader.o \
   skeleton.o symtab.o verbose.o warshall.o
openSUSE Build Service is sponsored by