Skip to content

Commit

Permalink
fixes for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Apr 18, 2024
1 parent 29d62a8 commit bffdde2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 10 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/mbt.yml
Expand Up @@ -54,10 +54,11 @@ jobs:
sudo apt-get install pkg-config autoconf-archive
else
brew upgrade;
brew install pkg-config;
brew install autoconf-archive;
brew install autoconf;
brew install automake;
brew install pkg-config
brew install libtool
brew install autoconf-archive
brew install autoconf
brew install automake
fi
- name: Install Dependencies
run: |
Expand Down
43 changes: 40 additions & 3 deletions bootstrap.sh
@@ -1,3 +1,5 @@
#!/bin/bash

# bootstrap - script to bootstrap the distribution rolling engine

# usage:
Expand Down Expand Up @@ -35,15 +37,50 @@ aclocal=aclocal
# svn log --verbose > ChangeLog
#}

if $automake --version|head -1 |grep ' 1\.[4-9]'; then
echo "automake 1.4-1.9 is active. You should use automake 1.10 or later"
# inspired by hack as used in mcl (from http://micans.org/)

# autoconf-archive Debian package, aclocal-archive RPM, obsolete/badly supported OS, installed in home dir
acdirs="/usr/share/autoconf-archive/ /usr/share/aclocal/ /usr/local/share/aclocal/ $HOME/local/share/autoconf-archive/ /opt/homebrew/share/aclocal/"

found=false
for d in $acdirs
do
if test -f ${d}pkg.m4
then
found=true
break
fi
done

if ! $found
then
cat <<EOT
You need the autoconf-archive Debian package, or the aclocal-archive
RPM package. Alternatively, you could install the GNU Autoconf Macro
Archive's http://autoconf-archive.cryp.to/ac_path_lib.html
as `pwd`/acinclude.m4.
EOT
fi


if $automake --version|head -1 |grep ' 1\.[4-8]'; then
echo "automake 1.4-1.8 is active. You should use automake 1.9 or later"
if test -f /etc/debian_version; then
echo " sudo apt-get install automake"
echo " sudo apt-get install automake1.9"
echo " sudo update-alternatives --config automake"
fi
exit 1
fi

if $aclocal --version|head -1 |grep ' 1\.[4-8]'; then
echo "aclocal 1.4-1.8 is active. You should use aclocal 1.9 or later"
if test -f /etc/debian_version; then
echo " sudo apt-get install aclocal1.9"
echo " sudo update-alternatives --config aclocal"
fi
exit 1
fi

# Debian automake package installs as automake-version. Use this
# to make sure the right automake is being used.
# if not installed, use: apt-get install automake1.9
Expand Down
18 changes: 15 additions & 3 deletions m4/ac_osx_pkg.m4
@@ -1,7 +1,7 @@
# osx_pkg.m4 - Macros to add OSX brew locations to pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
# serial 2 (pkg-config-0.24)
#
# Copyright © 2018 Ko van der Sloot <K.vanderSloot@let.ru.nl>
# Copyright © 2024 Ko van der Sloot <K.vanderSloot@let.ru.nl>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -40,6 +40,13 @@ case ${host_os} in
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/$i/lib/pkgconfig"
fi
done
for i in `ls /opt/homewbrew/opt`
do
if test -d "/opt/homebrew/opt/$i/lib/pkgconfig"
then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/homebrew/opt/$i/lib/pkgconfig"
fi
done
;;
esac
])
Expand All @@ -55,12 +62,17 @@ case ${host_os} in
# linux is wellbehaved
;;
darwin*)
# darwin isn't
# darwin/macos isn't
for i in $*
do
if test -d "/usr/local/opt/$i/lib/pkgconfig"
then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/$i/lib/pkgconfig"
else
if test -d "/opt/homebrew/opt//$i/lib/pkgconfig"
then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/homebrew/opt/$i/lib/pkgconfig"
fi
fi
done
;;
Expand Down

0 comments on commit bffdde2

Please sign in to comment.