updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / sge / sge-030809-build.patch
blob5b277a0a6b08a1c077fbe2c96eead4ef1d761856
1 --- Makefile.orig 2006-03-29 00:08:39.000000000 -0500
2 +++ Makefile 2006-03-29 00:09:36.000000000 -0500
3 @@ -2,7 +2,7 @@
5 include Makefile.conf
7 -CFLAGS += $(SGE_CFLAGS) -fPIC $(FT_CFLAGS)
8 +CXXFLAGS += $(SGE_CFLAGS) -fPIC $(FT_CFLAGS)
9 LIBS =$(SGE_LIBS)
11 SGE_VER = 030809
12 @@ -10,20 +10,26 @@
14 OBJECTS=sge_surface.o sge_primitives.o sge_tt_text.o sge_bm_text.o sge_misc.o sge_textpp.o sge_blib.o sge_rotation.o sge_collision.o sge_shape.o
16 -all: config $(OBJECTS)
17 - @ar rsc libSGE.a $(OBJECTS)
18 +SHARED_LIB=libSGE.so.$(API_VER)
19 +STATIC_LIB=libSGE.a
21 -$(OBJECTS): %.o:%.cpp %.h #Each object depends on thier .cpp and .h file
22 - $(CXX) $(CFLAGS) -c $<
23 +all: sge_config.h $(OBJECTS) $(SHARED_LIB) $(STATIC_LIB)
25 -shared: all
26 - $(CXX) $(CFLAGS) -Wl,-soname,libSGE.so.$(API_VER) -fpic -fPIC -shared -o libSGE.so $(OBJECTS) $(LIBS)
27 +$(STATIC_LIB): $(OBJECTS)
28 + $(AR) rsc libSGE.a $(OBJECTS)
30 -shared-strip: shared
31 +$(OBJECTS): sge_config.h
32 +$(OBJECTS): %.o:%.cpp %.h #Each object depends on their .cpp and .h file
33 + $(CXX) $(CXXFLAGS) -c $<
35 +$(SHARED_LIB): $(OBJECTS)
36 + $(CXX) $(CXXFLAGS) $(LDFLAGS) -Wl,-soname,libSGE.so.$(API_VER) -fpic -fPIC -shared -o libSGE.so $(OBJECTS) $(LIBS)
38 +shared-strip: $(SHARED_LIB)
39 @strip libSGE.so
41 # Building a dll... I have no idea how to do this, but it should be something like below.
42 -dll: config $(OBJECTS)
43 +dll: sge_config.h $(OBJECTS)
44 dlltool --output-def SGE.def $(OBJECTS)
45 dllwrap --driver-name $(CXX) -o SGE.dll --def SGE.def --output-lib libSGE.a --dllname SGE.dll $(OBJECTS) $(LIBS)
47 @@ -33,21 +39,22 @@
48 clean:
49 @rm -f *.o *.so *.a *.dll *.def
51 -config:
52 - @echo "/* SGE Config header (generated automatically) */" >sge_config.h
53 - @echo "#define SGE_VER $(SGE_VER)" >>sge_config.h
54 +sge_config.h:
55 + @echo "/* SGE Config header (generated automatically) */" >sge_config.h.tmp
56 + @echo "#define SGE_VER $(SGE_VER)" >>sge_config.h.tmp
57 ifeq ($(C_COMP),y)
58 - @echo "#define _SGE_C_AND_CPP" >>sge_config.h
59 + @echo "#define _SGE_C_AND_CPP" >>sge_config.h.tmp
60 endif
61 ifeq ($(USE_FT),n)
62 - @echo "#define _SGE_NOTTF" >>sge_config.h
63 + @echo "#define _SGE_NOTTF" >>sge_config.h.tmp
64 endif
65 ifeq ($(USE_IMG),y)
66 - @echo "#define _SGE_HAVE_IMG" >>sge_config.h
67 + @echo "#define _SGE_HAVE_IMG" >>sge_config.h.tmp
68 endif
69 ifeq ($(NO_CLASSES),y)
70 - @echo "#define _SGE_NO_CLASSES" >>sge_config.h
71 + @echo "#define _SGE_NO_CLASSES" >>sge_config.h.tmp
72 endif
73 + mv sge_config.h.tmp sge_config.h
75 ifneq ($(QUIET),y)
76 @echo "== SGE r$(SGE_VER)"
77 @@ -70,13 +77,13 @@
78 @echo ""
79 endif
81 -install: shared
82 - @mkdir -p $(PREFIX_H)
83 - install -c -m 644 sge*.h $(PREFIX_H)
84 - @mkdir -p $(PREFIX)/lib
85 - install -c -m 644 libSGE.a $(PREFIX)/lib
86 - install -c libSGE.so $(PREFIX)/lib/libSGE.so.$(API_VER).$(SGE_VER)
87 - @cd $(PREFIX)/lib;\
88 +install: $(SHARED_LIB) $(STATIC_LIB)
89 + @mkdir -p $(DESTDIR)$(PREFIX_H)
90 + install -c -m 644 sge*.h $(DESTDIR)$(PREFIX_H)
91 + @mkdir -p $(DESTDIR)$(PREFIX)/lib
92 + install -c -m 644 $(STATIC_LIB) $(DESTDIR)$(PREFIX)/lib
93 + install -c libSGE.so $(DESTDIR)$(PREFIX)/lib/libSGE.so.$(API_VER).$(SGE_VER)
94 + @cd $(DESTDIR)$(PREFIX)/lib;\
95 ln -sf libSGE.so.$(API_VER).$(SGE_VER) libSGE.so.$(API_VER);\
96 ln -sf libSGE.so.$(API_VER) libSGE.so
97 @echo "** Headerfiles installed in $(PREFIX_H)"
98 --- Makefile.conf.orig 2006-03-29 00:08:39.000000000 -0500
99 +++ Makefile.conf 2006-03-29 00:08:39.000000000 -0500
100 @@ -11,6 +11,7 @@
101 # Compilers (C and C++)
102 CC=gcc
103 CXX=g++
104 +AR=ar
106 # Make sure sdl-config is available
107 HAVE_SDL =$(shell if (sdl-config --version) < /dev/null > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
108 @@ -25,11 +26,13 @@
109 PREFIX_H =$(shell sdl-config --prefix)/include/SDL
111 # Flags passed to the compiler
112 -CFLAGS =-Wall -O3 -ffast-math
113 +CXXFLAGS ?=-O3 -ffast-math
114 SGE_CFLAGS =$(shell sdl-config --cflags)
115 # Uncomment to make some more optimizations
116 -#CFLAGS =-Wall -O9 -ffast-math -march=i686
117 +#CXXFLAGS =-O9 -ffast-math -march=i686
119 +# Spit out warnings
120 +CXXFLAGS += -Wall
122 # Libs config
123 SGE_LIBS =$(shell sdl-config --libs) -lstdc++