From cd3a8e232cd6b62dd8c31ecbd780c0944c84bce0 Mon Sep 17 00:00:00 2001
From: "Marc G. Fournier" <scrappy@hub.org>
Date: Tue, 13 Oct 1998 17:26:50 +0000
Subject: [PATCH] change configure so that if postgresql isn't being installed
 as root, do not configure in the perl5 interface.

the perl5 interface needs to be installed under /usr/local/lib/perl5/*, which
is generally owned by root.  This allows a non-root build/install with the
only root requirement being the make/install of hte perl5 stuff...
---
 src/backend/parser/gram.c |  8 ++++----
 src/backend/parser/scan.c |  4 ++--
 src/configure             | 18 +++++++++---------
 src/configure.in          | 18 +++++++++---------
 4 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/backend/parser/gram.c b/src/backend/parser/gram.c
index 1db4867fc4f..ff17bfc0386 100644
--- a/src/backend/parser/gram.c
+++ b/src/backend/parser/gram.c
@@ -229,7 +229,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.44 1998/10/09 21:28:42 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.45 1998/10/13 17:26:41 scrappy Exp $
  *
  * HISTORY
  *	  AUTHOR			DATE			MAJOR EVENT
@@ -4450,7 +4450,7 @@ static const short yycheck[] = {     3,
     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   204
 };
 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/usr/local/bison/bison.simple"
+#line 3 "/usr/local/share/bison.simple"
 
 /* Skeleton output parser for bison,
    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -4643,7 +4643,7 @@ __yy_memcpy (char *to, char *from, int count)
 #endif
 #endif
 
-#line 196 "/usr/local/bison/bison.simple"
+#line 196 "/usr/local/share/bison.simple"
 
 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
    into yyparse.  The argument should have type void *.
@@ -10398,7 +10398,7 @@ case 929:
     break;}
 }
    /* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/local/bison/bison.simple"
+#line 498 "/usr/local/share/bison.simple"
 
   yyvsp -= yylen;
   yyssp -= yylen;
diff --git a/src/backend/parser/scan.c b/src/backend/parser/scan.c
index 0ff46f73f1c..528cd7f1cde 100644
--- a/src/backend/parser/scan.c
+++ b/src/backend/parser/scan.c
@@ -1,7 +1,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * /master/usr.bin/lex/skel.c,v 1.3 1997/09/25 00:10:23 jch Exp
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.31 1998/10/13 17:26:50 scrappy Exp $
  */
 
 #define FLEX_SCANNER
@@ -556,7 +556,7 @@ char *yytext;
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.30 1998/10/09 03:07:54 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.31 1998/10/13 17:26:50 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
diff --git a/src/configure b/src/configure
index a1347355559..37df3228059 100755
--- a/src/configure
+++ b/src/configure
@@ -889,8 +889,8 @@ if test "${with_perl+set}" = set; then
   withval="$with_perl"
   
 	case "$withval" in
-	y | ye | yes)		USE_PERL=true; echo "$ac_t""enabled" 1>&6 ;;
-	*)			USE_PERL=false; echo "$ac_t""disabled" 1>&6 ;;
+	y | ye | yes)	USE_PERL=true; echo "$ac_t""enabled" 1>&6 ;;
+	*)		USE_PERL=false; echo "$ac_t""disabled" 1>&6 ;;
 	esac
    
 else
@@ -901,13 +901,13 @@ fi
 
 #dnl Verify that postgres is already installed
 #dnl per instructions for perl interface installation
-#if test "$USE_PERL" = "true"
-#then
-#	if test ! -x "$prefix"/bin/postgres -a ! -x "$ac_default_prefix"/bin/postgres
-#	then	AC_MSG_WARN(perl support disabled; postgres not previously installed)
-#		USE_PERL=
-#	fi
-#fi
+if test "$USE_PERL" = "true"
+then
+	if test "$WHOAMI" != "root"
+	then	echo "configure: warning: perl support disabled; must be root to install" 1>&2
+		USE_PERL=
+	fi
+fi
 export USE_PERL
 
 echo $ac_n "checking setting USE_ODBC""... $ac_c" 1>&6
diff --git a/src/configure.in b/src/configure.in
index 78064e4077c..23b159f280a 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -259,8 +259,8 @@ AC_ARG_WITH(
    [  --with-perl             use perl ],
    [
 	case "$withval" in
-	y | ye | yes)		USE_PERL=true; AC_MSG_RESULT(enabled) ;;
-	*)			USE_PERL=false; AC_MSG_RESULT(disabled) ;;
+	y | ye | yes)	USE_PERL=true; AC_MSG_RESULT(enabled) ;;
+	*)		USE_PERL=false; AC_MSG_RESULT(disabled) ;;
 	esac
    ],
    [ USE_PERL=false; AC_MSG_RESULT(disabled) ]
@@ -268,13 +268,13 @@ AC_ARG_WITH(
 
 #dnl Verify that postgres is already installed
 #dnl per instructions for perl interface installation
-#if test "$USE_PERL" = "true"
-#then
-#	if test ! -x "$prefix"/bin/postgres -a ! -x "$ac_default_prefix"/bin/postgres
-#	then	AC_MSG_WARN(perl support disabled; postgres not previously installed)
-#		USE_PERL=
-#	fi
-#fi
+if test "$USE_PERL" = "true"
+then
+	if test "$WHOAMI" != "root"
+	then	AC_MSG_WARN(perl support disabled; must be root to install)
+		USE_PERL=
+	fi
+fi
 export USE_PERL
 
 dnl We include odbc support unless we disable it with --with-odbc=false
-- 
GitLab