Add to Gambit REPL some functions to send SMS and take pictures (this functionnality...
[gambit-c.git] / prebuilt / macosx / postflight.in
blobfae6f0d4060ea108bcfa6b81c716e8e7a8443958
1 #! /bin/sh
3 # Copyright (c) 1994-2009 by Marc Feeley, All Rights Reserved.
5 PROGRAMS="@PROGRAMS@"
6 LIBRARIES="@LIBRARIES@"
7 INCLUDES="@INCLUDES@"
9 BIN_DIR="@BIN_DIR@"
10 LIB_DIR="@LIB_DIR@"
11 INCLUDE_DIR="@INCLUDE_DIR@"
13 INSTALL_DIR="@INSTALL_DIR@"
14 GAMBC_BIN_DIR="$INSTALL_DIR/current/bin"
15 GAMBC_LIB_DIR="$INSTALL_DIR/current/lib"
16 GAMBC_INCLUDE_DIR="$INSTALL_DIR/current/include"
18 install_safely() # dir, gambc_dir, files
20 DIR="$1"
21 GAMBC_DIR="$2"
22 FILES="$3"
24 EXISTING_CORRECT=""
25 EXISTING_INCORRECT=""
26 MISSING=""
28 for f in $FILES ; do
30 if [ -e "$DIR/$f" ] ; then
31 if [ -L "$DIR/$f" -a "`readlink \"$DIR/$f\"`" == "$GAMBC_DIR/$f" ] ; then
32 EXISTING_CORRECT="$EXISTING_CORRECT $f"
33 else
34 EXISTING_INCORRECT="$EXISTING_INCORRECT $f"
36 else
37 MISSING="$MISSING $f"
40 done
42 for f in $EXISTING_INCORRECT ; do
44 # This should not happen because the InstallationCheck script aborts
45 # the installation when an existing file would be clobbered.
46 # However for safety we save the file under a different name.
48 mv "$DIR/$f" "$DIR/$f-orig"
50 done
52 for f in $EXISTING_INCORRECT $MISSING ; do
53 ln -s "$GAMBC_DIR/$f" "$DIR/$f"
54 done
57 install_safely "$BIN_DIR" "$GAMBC_BIN_DIR" "$PROGRAMS"
58 install_safely "$LIB_DIR" "$GAMBC_LIB_DIR" "$LIBRARIES"
59 install_safely "$INCLUDE_DIR" "$GAMBC_INCLUDE_DIR" "$INCLUDES"