[BACK]Return to patch-ab CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / editors / elvis / patches

File: [cvs.NetBSD.org] / pkgsrc / editors / elvis / patches / patch-ab (download)

Revision 1.6, Fri Apr 21 13:03:08 2017 UTC (3 years, 7 months ago) by jperkin
Branch: MAIN
CVS Tags: pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, HEAD
Changes since 1.5: +9 -3 lines

Honour LDFLAGS.

$NetBSD: patch-ab,v 1.6 2017/04/21 13:03:08 jperkin Exp $

 - Support passing sysconfdir as a configure option.
 - Honor COMPILER_RPATH_FLAG.
 - Use pkgconfig to find freetype.

--- configure.orig	2003-10-21 02:32:25.000000000 +0000
+++ configure
@@ -27,6 +27,7 @@ GUI_GNOME=bug
 #	 --bindir=DIR		where to install the executables
 #	 --datadir=DIR		where to install the supporting data files
 #	 --docdir=DIR		where to install the :help files & other docs
+#	 --sysconfdir=DIR	where to install the configuration files
 #	 --prefix=DIR		like --bindir=DIR/bin --datadir=DIR/lib/elvis
 #	 --ioctl=VARIETY	type of tty ioctl to use: termios, termio, sgtty
 #	 --verbose		explain each decision
@@ -66,6 +67,7 @@ PREFIX=/usr
 BINDIR='$(PREFIX)/bin'
 DATADIR='$(PREFIX)/share/elvis/'
 DOCDIR='$(PREFIX)/share/elvis/doc/'
+SYSCONFDIR='/etc/elvis'
 SYS=""
 DEFAULT_CC="cc -O"
 IOCTL=""
@@ -130,6 +132,7 @@ usage()
 	echo "       --x-libraries=DIR  add DIR to path for X-windows libraries"
 	echo "       --bindir=DIR       where to install the executables"
 	echo "       --datadir=DIR      where to install the supporting data files"
+	echo "       --sysconfdir=DIR   where to install the configuration files"
 	echo "       --prefix=DIR       like --bindir=DIR/bin --datadir=DIR/share/elvis"
 	echo "       --libs=STRING      non-X11 part of the LIBS= string in Makefile"
 	echo "       --ioctl=VARIETY    type of tty ioctl to use: termios, termio, or sgtty"
@@ -157,14 +160,6 @@ do
 		GUI_GNOME=define
 		args="$args --with-gnome"
 		;;
-	  --with-x=no|--without-x)
-		GUI_X11=undef
-		args="$args --with-x=no"
-		;;
-	  --with-x*)
-		GUI_X11=define
-		args="$args --with-x"
-		;;
 	  --with-xft=no|--without-xft)
 		FEATURE_XFT=undef
 		args="$args --with-xft=no"
@@ -173,6 +168,14 @@ do
 		FEATURE_XFT=define
 		args="$args --with-xft"
 		;;
+	  --with-x=no|--without-x)
+		GUI_X11=undef
+		args="$args --with-x=no"
+		;;
+	  --with-x*)
+		GUI_X11=define
+		args="$args --with-x"
+		;;
 	  --with-gcc=no|--without-gcc)
 		gnu=n
 		forcegcc=n
@@ -203,6 +206,10 @@ do
 		DOCDIR=`echo "$i"|sed 's/^--docdir=//'`
 		args="$args $i"
 		;;
+	  --sysconfdir=*)
+		SYSCONFDIR=`echo "$i"|sed 's/^--sysconfdir=//'`
+		args="$args $i"
+		;;
 	  --prefix=*)
 		PREFIX=`echo "$i"|sed 's/^--prefix=//'`
 		args="$args $i"
@@ -726,7 +733,7 @@ case "$SYS" in
 	if [ "$GUI_X11" = "define" ]
 	then
 		xlibdir=`dirname "$xlib"`
-		XLIBS=" -R$xlibdir$XLIBS"
+		XLIBS=" ${COMPILER_RPATH_FLAG}$xlibdir$XLIBS"
 	fi
 	if [ -f /usr/ccs/lib/libtermcap.a ]
 	then
@@ -804,7 +811,7 @@ case "$SYS" in
 	if [ "$GUI_X11" = "define" ]
 	then
 		xlibdir=`dirname "$xlib"`
-		XLIBS=" -R$xlibdir$XLIBS"
+		XLIBS=" ${COMPILER_RPATH_FLAG}$xlibdir$XLIBS"
 	fi
 	;;
 
@@ -886,6 +893,7 @@ echo "Compiler: $CC"
 echo "Bin dir:  "`echo "$BINDIR" |sed s,'$(PREFIX)',"$PREFIX",`
 echo "Data dir: "`echo "$DATADIR"|sed s,'$(PREFIX)',"$PREFIX",`
 echo "Doc dir:  "`echo "$DOCDIR" |sed s,'$(PREFIX)',"$PREFIX",`
+echo "Conf dir: "`echo "$SYSCONFDIR"|sed s,'$(PREFIX)',"$PREFIX",`
 echo "Man dir:  "`sh instman.sh -d -p"${PREFIX}"`
 [ "$WHY" ] || echo "To see details, run \"configure --verbose\""
 
@@ -905,11 +913,8 @@ if [ "$GUI_X11" = "define" ]
 then
 	case "$FEATURE_XFT" in
 	  define)
-		xft="-lXft "
-		if [ -d /usr/include/freetype2 ]
-		then
-			CC="$CC -I/usr/include/freetype2"
-		fi
+		xft="`pkg-config --libs freetype2 xft` "
+		CC="$CC `pkg-config --cflags freetype2 xft`"
 		;;
 	  *)	
 		xft=""
@@ -950,7 +955,7 @@ esac
 
 
 # Generate the "config.h" file
-ELVISPATH=`echo "~/.elvis:/etc/elvis:$DATADIR:$DOCDIR" | sed s,'$(DATADIR)',"$DATADIR",g\;s,'$(PREFIX)',"$PREFIX",g`
+ELVISPATH=`echo "~/.elvis:$SYSCONFDIR:$DATADIR:$DOCDIR" | sed s,'$(DATADIR)',"$DATADIR",g\;s,'$(PREFIX)',"$PREFIX",g`
 cat >config.h <<eof-config
 /* config.h */
 
@@ -1195,11 +1200,12 @@ eof-generic
 
 esac
 cat >>$tmp <<eof-all
-s!^LIBS=.*!LIBS=$GNOMELIBS $XLIBS $LIBS!
+s!^LIBS=.*!LIBS=$LDFLAGS $GNOMELIBS $XLIBS $LIBS!
 s!^PREFIX=.*!PREFIX=$PREFIX!
 s!^BINDIR=.*!BINDIR=$BINDIR!
 s!^DATADIR=.*!DATADIR=$DATADIR!
 s!^DOCDIR=.*!DOCDIR=$DOCDIR!
+s!^SYSCONFDIR=.*!SYSCONFDIR=$SYSCONFDIR!
 eof-all
 if [ -d /usr/local/X11/include ]
 then