Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corner case: MacOS build fails if sh doesn't understand $(...) #18099

Open
mjreed-wbd opened this issue Aug 30, 2020 · 1 comment
Open

Corner case: MacOS build fails if sh doesn't understand $(...) #18099

mjreed-wbd opened this issue Aug 30, 2020 · 1 comment

Comments

@mjreed-wbd
Copy link

This is a bug report for perl from markjreed@gmail.com,
generated with the help of perlbug 1.42 running under perl 5.32.0.


[Please describe your issue here]
On one of my Macs I have installed the Heirloom Bourne shell,
used to check script compatibility with ancient versions of sh.
So when someone - be it plenv's perl-install, or me manually
following the usual instructions - runs sh ./Configure, it
blows up on the darwin hints file

./Configure: syntax error at line 346: `prodvers_minor=$' unexpected

That's actually line 346 of hints/darwin.sh:

prodvers_minor=$(echo $prodvers|awk -F. '{print $2}')

because the Heirloom shell doesn't understand the by-now
35-year-old "new" ksh/POSIX command-substitution syntax $(...).

I know that compatibility with really old UNIXes is not a priority,
and I may have the only system that is running both MacOS and
such an old version of sh. But the original Configure had a lot of
effort put into maintaing compatibility with just about everything,
and this is the only piece that doesn't work under Heirloom.; all
the other command substitutions use backticks. So It
Would Be Nice to fix it.

[Please do not change anything below this line]


Flags:
category=install
severity=low

Site configuration information for perl 5.32.0:

Configured by brew at Mon Jun 22 21:54:31 BST 2020.

Summary of my perl5 (revision 5 version 32 subversion 0) configuration:

Platform:
osname=darwin
osvers=19.5.0
archname=darwin-thread-multi-2level
uname='darwin catalina 19.5.0 darwin kernel version 19.5.0: tue may 26 20:41:44 pdt 2020; root:xnu-6153.121.2~2release_x86_64 x86_64 '
config_args='-des -Dprefix=/usr/local/Cellar/perl/5.32.0 -Dprivlib=/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0 -Dsitelib=/usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0 -Dotherlibdirs=/usr/local/lib/perl5/site_perl/5.32.0 -Dperlpath=/usr/local/opt/perl/bin/perl -Dstartperl=#!/usr/local/opt/perl/bin/perl -Dman1dir=/usr/local/Cellar/perl/5.32.0/share/man/man1 -Dman3dir=/usr/local/Cellar/perl/5.32.0/share/man/man3 -Duseshrplib -Duselargefiles -Dusethreads -Dsed=/usr/bin/sed'
hint=recommended
useposix=true
d_sigaction=define
useithreads=define
usemultiplicity=define
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
default_inc_excludes_dot=define
bincompat5005=undef
Compiler:
cc='cc'
ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.15 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV'
optimize='-O3'
cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.15 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=16
longdblkind=3
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='cc'
ldflags =' -mmacosx-version-min=10.15 -fstack-protector-strong -L/usr/local/lib'
libpth=/usr/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/lib /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib
libs=-lpthread -ldbm -ldl -lm -lutil -lc
perllibs=-lpthread -ldl -lm -lutil -lc
libc=
so=dylib
useshrplib=true
libperl=libperl.dylib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=bundle
d_dlsymun=undef
ccdlflags=' '
cccdlflags=' '
lddlflags=' -mmacosx-version-min=10.15 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong'


@inc for perl 5.32.0:
/usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/darwin-thread-multi-2level
/usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0
/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level
/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0
/usr/local/lib/perl5/site_perl/5.32.0/darwin-thread-multi-2level
/usr/local/lib/perl5/site_perl/5.32.0


Environment for perl 5.32.0:
DYLD_LIBRARY_PATH (unset)
HOME=/Users/mjreed
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin
PERL_BADLANG (unset)
SHELL=/bin/zsh

@Tux
Copy link
Contributor

Tux commented Aug 30, 2020

Does

prodvers_minor=`echo $prodvers | awk -F. '{print $2}'`

work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants