Ports that use CONFIGURE_STYLE=imake don't actually honor the CC,
CFLAGS, CXX, CXXFLAGS settings.  They just pick up whatever is
hardcoded in devel/imake-cf.  This behavior has grown historically
and there is really no good reason for it.

Here's a patch to change it.

ok?

Index: infrastructure/mk/imake.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/imake.port.mk,v
retrieving revision 1.9
diff -u -p -r1.9 imake.port.mk
--- infrastructure/mk/imake.port.mk     26 Apr 2016 10:56:59 -0000      1.9
+++ infrastructure/mk/imake.port.mk     6 Mar 2017 19:57:10 -0000
@@ -11,6 +11,10 @@ INSTALL_TARGET +=    install.man
 XMKMF ?=               xmkmf -a
 XMKMF +=               -DPorts
 
+.for _v in CC CFLAGS CXX CXXFLAGS
+MAKE_ENV +=            IMAKE_${_v}="${${_v}}"
+.endfor
+
 .if !exists(${X11BASE})
 IGNORE =       "uses imake, but ${X11BASE} not found"
 .endif
Index: devel/imake-cf/Makefile
===================================================================
RCS file: /cvs/ports/devel/imake-cf/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- devel/imake-cf/Makefile     25 Feb 2017 22:08:41 -0000      1.12
+++ devel/imake-cf/Makefile     6 Mar 2017 19:57:10 -0000
@@ -6,7 +6,7 @@ CATEGORIES =    devel x11
 V =            1.0.6
 DISTNAME =     xorg-cf-files-${V}
 PKGNAME =      imake-cf-${V}
-REVISION =     1
+REVISION =     2
 MASTER_SITES =         ${MASTER_SITE_XORG:=util/}
 
 PERMIT_PACKAGE_CDROM =                 Yes
Index: devel/imake-cf/patches/patch-OpenBSD_cf
===================================================================
RCS file: /cvs/ports/devel/imake-cf/patches/patch-OpenBSD_cf,v
retrieving revision 1.7
diff -u -p -r1.7 patch-OpenBSD_cf
--- devel/imake-cf/patches/patch-OpenBSD_cf     25 Feb 2017 22:08:42 -0000      
1.7
+++ devel/imake-cf/patches/patch-OpenBSD_cf     6 Mar 2017 19:57:10 -0000
@@ -1,7 +1,15 @@
 $OpenBSD: patch-OpenBSD_cf,v 1.7 2017/02/25 22:08:42 naddy Exp $
 --- OpenBSD.cf.orig    Tue Dec 22 02:28:02 2015
-+++ OpenBSD.cf Sat Feb 25 23:01:15 2017
-@@ -26,10 +26,12 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
++++ OpenBSD.cf Mon Mar  6 20:21:11 2017
+@@ -22,14 +22,20 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
+ 
+ #ifdef Ports
+ 
++#define CcCmd                 ${IMAKE_CC}
++#define DefaultCDebugFlags    ${IMAKE_CFLAGS}
++#define CplusplusCmd          ${IMAKE_CXX}
++#define DefaultCplusplusDebugFlags    ${IMAKE_CXXFLAGS}
+ #define BinDir                        /usr/local/bin
  #define LibDir                        /usr/local/lib/X11
  #define UsrLibDir             /usr/local/lib
  #define ManDirectoryRoot      /usr/local/man
@@ -15,7 +23,7 @@ $OpenBSD: patch-OpenBSD_cf,v 1.7 2017/02
  #define IncRoot                       /usr/local/include
  #define TopXInclude           -I/usr/X11R6/include
  #define ImakeCmd              imake -DPorts
-@@ -172,6 +174,9 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
+@@ -172,6 +178,9 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
  #ifndef CcCmd
  #define CcCmd                         cc
  #endif
@@ -25,7 +33,7 @@ $OpenBSD: patch-OpenBSD_cf,v 1.7 2017/02
  #ifndef AsCmd
  #define AsCmd                 cc -c -x assembler
  #endif
-@@ -244,9 +249,22 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
+@@ -244,9 +253,22 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
  /*
   * Documentation formatting
   */
@@ -51,7 +59,7 @@ $OpenBSD: patch-OpenBSD_cf,v 1.7 2017/02
  #define HasGroff              YES
  
  #ifndef HasCookieMaker
-@@ -262,77 +280,15 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
+@@ -262,77 +284,15 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
   */
  #define ManSuffix     1
  #define FileManSuffix 5
@@ -135,7 +143,7 @@ $OpenBSD: patch-OpenBSD_cf,v 1.7 2017/02
        done
  
  #define InstallManPageAliases(file,destdir,aliases)                   @@\
-@@ -436,8 +392,6 @@ install:: fonts.alias                                      
                @@\
+@@ -436,8 +396,6 @@ install:: fonts.alias                                      
                @@\
  #ifdef AMD64Architecture
  
  # define HasWeakSymbols               YES
@@ -144,7 +152,7 @@ $OpenBSD: patch-OpenBSD_cf,v 1.7 2017/02
  
  # define XorgServer           YES
  
-@@ -666,51 +620,26 @@ install:: fonts.alias                                    
                @@\
+@@ -666,51 +624,26 @@ install:: fonts.alias                                    
                @@\
  
  
  /*
-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to