Introduce d_sitearch and d_inc_version_list config.sh variables.
authorGisle Aas <gisle@activestate.com>
Thu, 30 Mar 2006 12:13:54 +0000 (12:13 +0000)
committerGisle Aas <gisle@activestate.com>
Thu, 30 Mar 2006 12:13:54 +0000 (12:13 +0000)
These allow me to set sitearch and sitelib to be the same without
ending up with duplicate entries in @INC.

Basically the same way the old d_archlib variable is used.

p4raw-id: //depot/perl@27632

Configure
Porting/Glossary
config_h.SH
perl.c

index 374eb39..d8c2933 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -921,6 +921,7 @@ i_varhdr=''
 i_vfork=''
 inc_version_list=''
 inc_version_list_init=''
+d_inc_version_list=''
 installprefix=''
 installprefixexp=''
 installstyle=''
@@ -1101,6 +1102,7 @@ sig_size=''
 installsitearch=''
 sitearch=''
 sitearchexp=''
+d_sitearch=''
 installsitebin=''
 sitebin=''
 sitebinexp=''
@@ -6584,6 +6586,11 @@ rp='Pathname for the site-specific architecture-dependent library files?'
 . ./getfile
 prefixvar=sitearch
 . ./setprefixvar
+if $test X"$sitearch" = X"$sitelib"; then
+       d_sitearch="$undef"
+else
+       d_sitearch="$define"
+fi
 
 $cat <<EOM
 
@@ -6984,9 +6991,12 @@ case "$ans" in
 esac
 case "$inc_version_list" in
 ''|' ') 
-       inc_version_list_init='0';;
+       inc_version_list_init='0'
+       d_inc_version_list="$undef"
+       ;;
 *)     inc_version_list_init=`echo $inc_version_list |
                $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
+       d_inc_version_list="$define"
        ;;
 esac
 $rm -f getverlist
@@ -21342,6 +21352,7 @@ d_grpasswd='$d_grpasswd'
 d_hasmntopt='$d_hasmntopt'
 d_htonl='$d_htonl'
 d_ilogbl='$d_ilogbl'
+d_inc_version_list="$d_inc_version_list"
 d_index='$d_index'
 d_inetaton='$d_inetaton'
 d_int64_t='$d_int64_t'
@@ -21496,6 +21507,7 @@ d_shmget='$d_shmget'
 d_sigaction='$d_sigaction'
 d_sigprocmask='$d_sigprocmask'
 d_sigsetjmp='$d_sigsetjmp'
+d_sitearch='$d_sitearch'
 d_snprintf='$d_snprintf'
 d_sockatmark='$d_sockatmark'
 d_sockatmarkproto='$d_sockatmarkproto'
index abf9756..488f28f 100644 (file)
@@ -1151,6 +1151,10 @@ d_ilogbl (d_ilogbl.U):
        indicates to the C program that the ilogbl() routine is available.
        If scalbnl is also present we can emulate frexpl.
 
+d_inc_version_list (inc_version_list.U):
+       This variable conditionally defines PERL_INC_VERSION_LIST.
+       It is set to undef when PERL_INC_VERSION_LIST is empty.
+
 d_index (d_strchr.U):
        This variable conditionally defines HAS_INDEX if index() and
        rindex() are available for string searching.
@@ -1907,6 +1911,11 @@ d_sigsetjmp (d_sigsetjmp.U):
        which indicates that the sigsetjmp() routine is available to
        call setjmp() and optionally save the process's signal mask.
 
+d_sitearch (sitearch.U):
+       This variable conditionally defines SITEARCH to hold the pathname
+       of architecture-dependent library files for $package.  If
+       $sitearch is the same as $archlib, then this is set to undef.
+
 d_sockatmark (d_sockatmark.U):
        This variable conditionally defines the HAS_SOCKATMARK symbol, which
        indicates to the C program that the sockatmark() routine is available.
index e76f08c..a0cc5aa 100644 (file)
@@ -3041,7 +3041,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
  *     for a C initialization string.  See the inc_version_list entry
  *     in Porting/Glossary for more details.
  */
-#define PERL_INC_VERSION_LIST $inc_version_list_init           /**/
+#$d_inc_version_list PERL_INC_VERSION_LIST $inc_version_list_init              /**/
 
 /* INSTALL_USR_BIN_PERL:
  *     This symbol, if defined, indicates that Perl is to be installed
@@ -3485,8 +3485,8 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
  *     This symbol contains the ~name expanded version of SITEARCH, to be used
  *     in programs that are not prepared to deal with ~ expansion at run-time.
  */
-#define SITEARCH "$sitearch"           /**/
-#define SITEARCH_EXP "$sitearchexp"            /**/
+#$d_sitearch SITEARCH "$sitearch"              /**/
+#$d_sitearch SITEARCH_EXP "$sitearchexp"               /**/
 
 /* SITELIB:
  *     This symbol contains the name of the private library for this package.
diff --git a/perl.c b/perl.c
index 7e0f842..9fe9f1e 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -4781,7 +4781,8 @@ S_init_perllib(pTHX)
 #  endif
 #endif
 
-#ifdef SITELIB_STEM /* Search for version-specific dirs below here */
+#if defined(SITELIB_STEM) && defined(PERL_INC_VERSION_LIST)
+    /* Search for version-specific dirs below here */
     incpush(SITELIB_STEM, FALSE, TRUE, TRUE, TRUE);
 #endif