configure: add --fat-binary-m1 for arm64e/x86_64 (M1) fat binary

addresses #451
closes #383
pull/476/head
rofl0r 2022-05-19 09:12:10 +00:00
parent 9b42da71f4
commit 4b531806b2
1 changed files with 8 additions and 0 deletions

8
configure vendored
View File

@ -86,6 +86,7 @@ usage() {
echo " if set to yes ignores CVE-2015-3887 and makes it possible"
echo " to preload from current dir (possibly insecure, but handy)"
echo "--fat-binary : build for both i386 and x86_64 architectures on 64-bit Macs"
echo "--fat-binary-m1 : build for both arm64e and x86_64 architectures on M1 Macs"
echo "--hookmethod=dlsym|dyld hook method for osx. default: auto"
echo " if OSX >= 12 is detected, dyld method will be used if auto."
echo "--help : show this text"
@ -100,6 +101,7 @@ spliteq() {
}
fat_binary=
fat_binary_m1=
ignore_cve=no
hookmethod=auto
@ -115,6 +117,7 @@ parsearg() {
--ignore-cve=*) ignore_cve=`spliteq $1`;;
--hookmethod=*) hookmethod=`spliteq $1`;;
--fat-binary) fat_binary=1;;
--fat-binary-m1) fat_binary_m1=1;;
--help) usage;;
esac
}
@ -277,6 +280,11 @@ if ismac ; then
echo "MAC_CFLAGS+=-arch i386 -arch x86_64">>config.mak
echo "LDFLAGS+=-arch i386 -arch x86_64">>config.mak
fi
if [ "$fat_binary_m1" = 1 ] ; then
echo "Configuring a fat binary for arm64e and x86_64"
echo "MAC_CFLAGS+=-arch arm64e -arch x86_64">>config.mak
echo "LDFLAGS+=-arch arm64e -arch x86_64">>config.mak
fi
elif isbsd ; then
echo LIBDL=>>config.mak
echo "CFLAGS+=-DIS_BSD">>config.mak