+libdir_in_ldconfig=0
+
+printf "Checking which platform we are on... "
+if [ `uname` = "Darwin" ] ; then
+ printf "Mac OS X.\n"
+ platform=MACOSX
+ linker_resolves_library_dependencies=0
+elif [ `uname` = "SunOS" ] ; then
+ printf "Solaris.\n"
+ platform=SOLARIS
+ linker_resolves_library_dependencies=0
+elif [ `uname` = "Linux" ] ; then
+ printf "Linux\n"
+ platform=LINUX
+ linker_resolves_library_dependencies=1
+ ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
+ for path in $ldconfig_paths; do
+ echo "Checking $path compared to $libdir_expanded"
+ if [ "$path" = "$libdir_expanded" ]; then
+ libdir_in_ldconfig=1
+ fi
+ done
+else
+ printf "Unknown.\n"
+ cat <<EOF
+
+*** Warning: Unknown platform. Notmuch might or might not build correctly.
+
+EOF
+fi
+