Skip to content

Instantly share code, notes, and snippets.

@maltoe
Created October 7, 2013 16:18
Show Gist options
  • Save maltoe/6870636 to your computer and use it in GitHub Desktop.
Save maltoe/6870636 to your computer and use it in GitHub Desktop.
Weird libtoolize behaviour with install.sh files in parent directories and chdir calls.
#!/bin/bash
mkdir weird_libtoolize_behaviour
cd weird_libtoolize_behaviour
mkdir works
cd works
git clone https://git.gitorious.org/openismus-playground/examplelib.git &>/dev/null
cd examplelib
./autogen.sh &>/dev/null
if [ -f Makefile.in ]; then
echo "Makefile.in exists in works/."
fi
cd ../..
mkdir fails
cd fails
git clone https://git.gitorious.org/openismus-playground/examplelib.git &>/dev/null
touch "install.sh" # !
cd examplelib
./autogen.sh &>/dev/null
if [ ! -f Makefile.in ]; then
echo "Makefile.in does NOT exist in fails/."
fi
cd ../..
echo "Now please go to the fails/examplelib/ directory and run ./autogen.sh yourself."
echo "And see what happens..."
echo
echo "When run with --verbose flag, libtool reports AC_CONFIG_AUX_DIR being not set when"
echo "run from within a shell that has a directory on its directory stack which contains a"
echo "install.sh script. - Even if the install.sh script lies in between the directory where"
echo "you came from. Proof:"
mkdir failstoo
cd failstoo
mkdir subdir
git clone https://git.gitorious.org/openismus-playground/examplelib.git subdir/examplelib &>/dev/null
touch "subdir/install.sh" # !
cd subdir/examplelib
./autogen.sh &>/dev/null
if [ ! -f Makefile.in ]; then
echo "Makefile.in does NOT exist in failstoo/."
fi
cd ../../..
cd ..
echo "Sorry for the traffic, gitorious.org."
# Versions used:
# * libtoolize 2.4.2
# * automake 1.11.6
# * autoconf 2.69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment