#! /bin/sh /usr/share/dpatch/dpatch-run ## 01_ungentooize.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Ungentooize the build system. ## DP: Do not modify CFLAGS if they're already set, this avoids building with -O9 -funroll-loops ## DP: and other funny and useless options. (hint: the optimization level stops at -O3 in gcc) @DPATCH@ diff -urNad openser-1.0.1/Makefile.defs /tmp/dpep.Deo9Fq/openser-1.0.1/Makefile.defs --- openser-1.0.1/Makefile.defs 2006-06-27 16:55:49.761532422 +0200 +++ /tmp/dpep.Deo9Fq/openser-1.0.1/Makefile.defs 2006-06-27 16:55:52.053040545 +0200 @@ -390,7 +390,7 @@ else echo "as" ; \ fi\ fi) - + LDTYPE=$(shell if $(LDPATH) -V 1>/dev/null 2>/dev/null; then \ if $(LDPATH) -V 2>&1|grep GNU >/dev/null; \ then echo gnu; \ @@ -471,8 +471,10 @@ found_lock_method=yes endif -CFLAGS= +CFLAGS=$(shell echo "$${CFLAGS}") LDFLAGS= + +ifeq (,$(CFLAGS)) # setting CFLAGS ifeq ($(mode), release) #if i386 @@ -507,7 +509,7 @@ ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ for better results) - + CFLAGS+=-m486 \ -malign-loops=4 else @@ -567,7 +569,7 @@ ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ for better results) - + CFLAGS+=-m486 \ -malign-loops=4 else @@ -646,12 +648,12 @@ #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + CFLAGS+= -mv8 ifeq ($(ASTYPE), solaris) CFLAGS+= -Wa,-xarch=v8plus endif - + endif #CC_SHORTVER, 2.9x endif #CC_SHORTVER, 3.0 endif #CC_SHORTVER, 3.4 @@ -693,18 +695,18 @@ ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ for better results) - + CFLAGS+= else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x - + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) @@ -735,18 +737,18 @@ ifeq ($(CC_SHORTVER), 2.9x) #older gcc version (2.9[1-5]) $(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ for better results) - + CFLAGS+=-mcpu=r3000 else #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x - + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) @@ -780,19 +782,18 @@ #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x - + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) endif #CC_NAME, gcc endif #ARCH, mips2 - #if alpha ifeq ($(ARCH), alpha) # if gcc @@ -819,12 +820,12 @@ #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x - + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) @@ -859,12 +860,12 @@ #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x - + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) @@ -898,18 +899,19 @@ #really old version $(warning You are using an old and unsupported gcc \ version ($(CC_SHORTVER)), compile at your own risk!) - + endif # CC_SHORTVER, 2.9x endif # CC_SHORTVER, 3.0 endif # CC_SHORTVER, 3.4 endif # CC_SHORTVER, 4.x - + else # CC_NAME, gcc #other compilers $(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) endif #CC_NAME, gcc endif #ARCH, ppc +endif # CFLAGS not set CFLAGS+= $(CC_EXTRA_OPTS) @@ -946,7 +948,7 @@ # -andrei else #mode,release ifeq ($(CC_NAME), gcc) - CFLAGS=-g -Wcast-align $(PROFILE) + CFLAGS += -g -Wcast-align $(PROFILE) ifeq ($(ARCH), sparc64) CFLAGS+= -mcpu=ultrasparc endif @@ -1075,13 +1077,13 @@ OPENBSD_IS_AOUT:=no endif endif - + ifeq ($(OPENBSD_IS_AOUT), yes) DEFS+=-DDLSYM_PREFIX='"_"' LDFLAGS= # openbsd ld doesn't like -O2 or -E endif endif # if opensd - + ifeq ($(OS), netbsd) DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 \ -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG