1157 |
|
AC_SUBST(enable_html_docs) |
1158 |
|
AC_SUBST(enable_latex_docs) |
1159 |
|
]) |
1160 |
+ |
# |
1161 |
+ |
# |
1162 |
+ |
# |
1163 |
+ |
AC_DEFUN([AX_SYS_PERLSHARPBANG],[dnl |
1164 |
+ |
|
1165 |
+ |
AC_PATH_PROG(PERLINTERP,perl,perl) |
1166 |
+ |
ac_cv_path_perlinterp="$PERLINTERP" |
1167 |
+ |
_sHpB='#!' |
1168 |
+ |
|
1169 |
+ |
AC_ARG_WITH(perl-shebang, |
1170 |
+ |
AC_HELP_STRING([--with-perl-shebang], |
1171 |
+ |
[override what perl thinks is the way for the kernel to start it (seldom needed)]dnl |
1172 |
+ |
), |
1173 |
+ |
[opt_perl_shebang="$withval"]dnl |
1174 |
+ |
,dnl |
1175 |
+ |
[opt_perl_shebang="not_set"]dnl |
1176 |
+ |
)dnl |
1177 |
+ |
|
1178 |
+ |
AC_CACHE_CHECK([whether explicit instead of detected sharpbang is to be used], |
1179 |
+ |
ax_cv_opt_perl_shebang, |
1180 |
+ |
[ case "$opt_perl_shebang" in |
1181 |
+ |
not_set ) ax_cv_opt_perl_shebang='' |
1182 |
+ |
;; |
1183 |
+ |
* ) |
1184 |
+ |
ax_cv_opt_perl_shebang=`echo "$opt_perl_shebang" | sed -e's|^#!\s*\(.*\)$|\1|'` |
1185 |
+ |
esac |
1186 |
+ |
]dnl |
1187 |
+ |
)dnl |
1188 |
+ |
|
1189 |
+ |
if test "A$ax_cv_opt_perl_shebang" != "A" |
1190 |
+ |
then |
1191 |
+ |
ac_cv_sys_kernshrpbang_perl="$ax_cv_opt_perl_shebang" |
1192 |
+ |
PERL_SHEBANG="$ac_cv_sys_kernshrpbang_perl" |
1193 |
+ |
AC_SUBST(PERL_SHEBANG)dnl |
1194 |
+ |
AC_MSG_NOTICE([OK - PERL_SHEBANG is $_sHpB$PERL_SHEBANG.]) |
1195 |
+ |
|
1196 |
+ |
# Automatic detection of sharpbang formula starts here |
1197 |
+ |
else dnl |
1198 |
+ |
|
1199 |
+ |
_somian_shbangperl=`$PERLINTERP -V:startperl` |
1200 |
+ |
negclass="[[^']]"; dnl |
1201 |
+ |
# must leave this comment: m4 will remove the outer brackets for us, heheh |
1202 |
+ |
AC_CACHE_CHECK([for kernel sharpbang invocation to start perl], |
1203 |
+ |
ac_cv_sys_kernshrpbang_perl, |
1204 |
+ |
[_somian_kspb_perl=`echo "$_somian_shbangperl" | sed -ne"s|.*='\($negclass*\)';$|\1|p"` |
1205 |
+ |
if test "x$_somian_kspb_perl" == x |
1206 |
+ |
then _somian_ksbp_warn_empty='durnit' |
1207 |
+ |
else |
1208 |
+ |
case "A$_somian_kspb_perl" in |
1209 |
+ |
A#!*perl* ) |
1210 |
+ |
ac_cv_sys_kernshrpbang_perl=`echo "$_somian_kspb_perl" | sed -e's|#!\(.*\)$|\1|'` |
1211 |
+ |
;; |
1212 |
+ |
A* ) _somian_ksbp_warn_defau='trouble' |
1213 |
+ |
ac_cv_sys_kernshrpbang_perl="$PERLINTERP" |
1214 |
+ |
esac |
1215 |
+ |
fi |
1216 |
+ |
])dnl Done with testing sharpbang |
1217 |
|
|
1218 |
+ |
# The above prints Checking ... result message to user. |
1219 |
+ |
PERL_SHEBANG="$ac_cv_sys_kernshrpbang_perl" |
1220 |
+ |
AC_SUBST(PERL_SHEBANG) |
1221 |
+ |
if test A${_somian_ksbp_warn_empty+set} == Aset |
1222 |
+ |
then AC_MSG_WARN([dnl |
1223 |
+ |
In last check, doing $PERLINTERP -V:startperl yielded empty result! That should not happen.]) |
1224 |
+ |
fi |
1225 |
+ |
# Inform user after printing result value |
1226 |
+ |
if test A${_somian_ksbp_warn_defau+set} == Aset |
1227 |
+ |
then AC_MSG_NOTICE([Maybe Not good -]) |
1228 |
+ |
AC_MSG_WARN([dnl |
1229 |
+ |
In last check perl's Config query did not work so we bunted: $_sHpB$PERLINTERP]) |
1230 |
+ |
else AC_MSG_NOTICE([OK Good result - ]) |
1231 |
+ |
AC_MSG_NOTICE([dnl |
1232 |
+ |
In last check we got a proper-looking answer from perl's Config: $_somian_shbangperl]) |
1233 |
+ |
dnl Done with user info messages |
1234 |
+ |
fi |
1235 |
+ |
dnl Outer loop checked for user override term here |
1236 |
+ |
fi dnl |
1237 |
+ |
|
1238 |
+ |
])dnl EOMACRO DEF |