File ocaml-3.09-rpmoptflags.patch of Package ocaml
Index: asmrun/Makefile
===================================================================
--- asmrun/Makefile.orig
+++ 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: configure
===================================================================
--- configure.orig
+++ configure
@@ -331,7 +331,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: otherlibs/Makefile
===================================================================
--- otherlibs/Makefile.orig
+++ 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: otherlibs/labltk/support/Makefile
===================================================================
--- otherlibs/labltk/support/Makefile.orig
+++ otherlibs/labltk/support/Makefile
@@ -12,7 +12,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: otherlibs/systhreads/Makefile
===================================================================
--- otherlibs/systhreads/Makefile.orig
+++ otherlibs/systhreads/Makefile
@@ -30,10 +30,10 @@
allopt: libthreadsnat.a threads.cmxa
libthreads.a: $(BYTECODE_C_OBJS)
- $(MKLIB) -o threads $(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 @@
$(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: otherlibs/threads/Makefile
===================================================================
--- otherlibs/threads/Makefile.orig
+++ 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: yacc/Makefile
===================================================================
--- yacc/Makefile.orig
+++ 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