aboutsummaryrefslogtreecommitdiff
path: root/irc/irssi/files/patch-configure
blob: d244d1b53e4b5ed3960b06a49e747aa9b9458fa4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
--- configure.orig	2016-03-23 07:25:26.000000000 +0800
+++ configure	2016-05-18 14:02:01.998133000 +0800
@@ -652,6 +652,7 @@ BUILD_TEXTUI_FALSE
 BUILD_TEXTUI_TRUE
 PERL_STATIC_LIBS
 PERL_MM_PARAMS
+PERL_MM_OPT
 PERL_USE_LIB
 PERL_CFLAGS
 PERL_LDFLAGS
@@ -1502,7 +1503,7 @@ Optional Packages:
   --with-modules          Specify what modules to build in binary
   --with-perl-staticlib   Specify that we want to link perl libraries
                           statically in irssi, default is no
-  --with-perl-lib=site|vendor|DIR  Specify where to install the
+  --with-perl-lib=perl|site|vendor|DIR  Specify where to install the
                           Perl libraries for irssi, default is site
   --with-perl=yes|no|module  Build with Perl support - also specifies
                           if it should be built into main irssi binary
@@ -12715,7 +12716,6 @@ fi
 if test "x$prefix" != "xNONE"; then
 	prefix=`eval echo $prefix`
 	PERL_MM_PARAMS="INSTALLDIRS=perl INSTALL_BASE=$prefix"
-	perl_library_dir="PERL_USE_LIB"
 	perl_set_use_lib=yes
 
 	perl_prefix_note=yes
@@ -12742,24 +12742,29 @@ if test "${with_perl_lib+set}" = set; th
 		want_perl=yes
 	elif test "x$withval" = xno; then
 		want_perl=no
+	elif test "x$withval" = xperl; then
+		want_perl=yes
+		perl_prefix_note=no
+		PERL_MM_PARAMS="INSTALLDIRS=perl"
+		perl_set_use_lib=no
 	elif test "x$withval" = xsite; then
 		want_perl=yes
 		perl_prefix_note=no
 		PERL_MM_PARAMS=""
+		perl_set_use_lib=no
 	elif test "x$withval" = xvendor; then
 		want_perl=yes
 		perl_prefix_note=no
 		if test -z "`$perlpath -v|grep '5\.0'`"; then
 			PERL_MM_PARAMS="INSTALLDIRS=vendor"
 		else
-			PERL_MM_PARAMS="INSTALLDIRS=perl PREFIX=`perl -e 'use Config; print $Config{prefix}'`"
+			PERL_MM_PARAMS="INSTALLDIRS=perl PREFIX=`$perlpath -e 'use Config; print $Config{prefix}'`"
 		fi
-		perl_library_dir="(vendor default - `$perlpath -e 'use Config; print $Config{archlib}'`)"
+		perl_set_use_lib=no
 	else
 		want_perl=yes
 		perl_prefix_note=no
 		PERL_MM_PARAMS="INSTALLDIRS=perl LIB=$withval"
-		perl_library_dir="PERL_USE_LIB"
 		perl_set_use_lib=yes
 	fi
 else
@@ -13849,12 +13854,12 @@ if test "${with_ncurses+set}" = set; the
 
     if $search_ncurses
     then
-        if test -f $withval/include/ncurses.h
+        if test -f $withval/include/ncurses/ncurses.h
 	then
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found ncurses on $withval/include/ncurses.h" >&5
-$as_echo "Found ncurses on $withval/include/ncurses.h" >&6; }
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found ncurses on $withval/include/ncurses/ncurses.h" >&5
+$as_echo "Found ncurses on $withval/include/ncurses/ncurses.h" >&6; }
 
-	    CURSES_LIBS="-L$withval/lib -lncurses"
+	    CURSES_LIBS="-L$withval/lib -lncurses -ltinfo"
 	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5
 $as_echo_n "checking for initscr in -lncurses... " >&6; }
 if ${ac_cv_lib_ncurses_initscr+:} false; then :
@@ -14921,7 +14926,7 @@ $as_echo_n "checking for working Perl su
 	fi
 
 	if test "x$ac_cv_c_compiler_gnu" = "xyes" -a -z "`echo $host_os|grep 'bsd\|linux'`"; then
-														PERL_CFLAGS=`echo $PERL_CFLAGS | $perlpath -pe 's/^(.* )?-^DUIfm^ +/\1/g; s/^(.* )?\+^ +/\1/g'`
+														PERL_CFLAGS=`echo $PERL_CFLAGS | $perlpath -pe 's/^(.* )?-[^DUIfm][^ ]+/\1/g; s/^(.* )?\+[^ ]+/\1/g'`
 
 		PERL_EXTRA_OPTS="CCCDLFLAGS=\"-fPIC\""
 
@@ -15000,13 +15005,37 @@ $as_echo "ok" >&6; }
 			PERL_STATIC_LIBS=0
 		fi
 
+		# remove any prefix from PERL_MM_OPT
+		PERL_MM_OPT=`perl -MText::ParseWords -e 'sub qu{$_=shift;s{^(.*?)=(.*)$}{($a,$b)=($1,$2);$b=~s/"/\\\\"/g;qq{$a="$b"}}ge if /[\s"]/;$_} local $,=" "; print map qu($_), grep !/^(INSTALL_BASE|PREFIX)=/, shellwords(@ARGV)' "$PERL_MM_OPT"`
+		$perlpath -MExtUtils::MakeMaker -e 'WriteMakefile(NAME => "test", MAKEFILE => "Makefile.test", FIRST_MAKEFILE => "/dev/null", NO_META => 1, NO_MYMETA => 1);' $PERL_MM_PARAMS >/dev/null
+		echo 'show-INSTALLDIRS:' >> Makefile.test
+		echo '	@echo $(INSTALLDIRS)' >> Makefile.test
+		perl_INSTALLDIRS=`$am_make -s -f Makefile.test show-INSTALLDIRS`
+		if test "x$perl_INSTALLDIRS" = "xsite"; then
+			perl_library_dir="site default"
+			perl_INSTALL_VAR=INSTALLSITEARCH
+		elif test "x$perl_INSTALLDIRS" = "xvendor"; then
+			perl_library_dir="vendor default"
+			perl_INSTALL_VAR=INSTALLVENDORARCH
+		else
+			perl_library_dir="module default"
+			perl_INSTALL_VAR=INSTALLARCHLIB
+		fi
+		echo 'show-ARCHLIB:' >> Makefile.test
+		echo '	@echo $('"$perl_INSTALL_VAR"')' >> Makefile.test
+		perl_use_lib=`$am_make -s -f Makefile.test show-ARCHLIB`
+		rm -f Makefile.test
 		# figure out the correct @INC path - we'll need to do this
 		# through MakeMaker since it's difficult to get it right
 		# otherwise.
 		if test "x$perl_set_use_lib" = "xyes"; then
-			perl -e 'use ExtUtils::MakeMaker; WriteMakefile("NAME" => "test", "MAKEFILE" => "Makefile.test");' $PERL_MM_PARAMS >/dev/null
-			PERL_USE_LIB=`perl -e 'open(F, "Makefile.test"); while (<F>) { chomp; if (/^(\w+) = (.*$)/) { $keys{$1} = $2; } }; $key = $keys{INSTALLARCHLIB}; while ($key =~ /\\$\((\w+)\)/) { $value = $keys{$1}; $key =~ s/\\$\($1\)/$value/; }; print $key;'`
-			rm -f Makefile.test
+			if $perlpath -e 'exit ! grep $_ eq $ARGV[0], grep /^\//, @INC' "$perl_use_lib"; then
+				perl_library_dir="other path in @INC"
+				perl_set_use_lib=no
+			else
+				perl_library_dir="prepends to @INC with /set perl_use_lib"
+				PERL_USE_LIB="$perl_use_lib"
+			fi
 		fi
 
 
@@ -15024,6 +15053,7 @@ $as_echo "ok" >&6; }
 
 
 
+
 	fi
 fi
 
@@ -17024,6 +17054,7 @@ $as_echo X"$file" |
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
 # Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 
 # Provide generalized library-building support services.
@@ -17657,13 +17688,7 @@ if test "x$want_perl" != "xno" -a "x$per
 fi
 
 if test "x$want_perl" != "xno"; then
-	if test "$perl_library_dir" = "PERL_USE_LIB"; then
-		perl_library_dir=$PERL_USE_LIB
-	fi
-	if test -z "$perl_library_dir"; then
-		perl_library_dir="(site default - `$perlpath -e 'use Config; print $Config{sitearch}'`)"
-	fi
-	echo "Perl library directory ........... : $perl_library_dir"
+	echo "Perl library directory ........... : ($perl_library_dir - $perl_use_lib)"
 	if test "x$perl_prefix_note" = "xyes"; then
 		echo "  - NOTE: This was automatically set to the same directory you gave with"
 		echo "  --prefix. If you want the perl libraries to install to their 'correct'"