Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # |
| 4 | # Simple shell script for installing Mesa's header and library files. |
| 5 | # If the copy commands below don't work on a particular system (i.e. the |
| 6 | # -f or -d flags), we may need to branch on `uname` to do the right thing. |
| 7 | # |
| 8 | |
| 9 | |
| 10 | TOP=. |
| 11 | |
| 12 | INCLUDE_DIR="/usr/local/include" |
| 13 | LIB_DIR="/usr/local/lib" |
| 14 | |
Brian Paul | 7bb7f97 | 2005-09-13 13:36:47 +0000 | [diff] [blame] | 15 | if [ "x$#" = "x0" ] ; then |
Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 16 | echo |
| 17 | echo "***** Mesa installation - You may need root privileges to do this *****" |
| 18 | echo |
| 19 | echo "Default directory for header files is:" ${INCLUDE_DIR} |
| 20 | echo "Enter new directory or press <Enter> to accept this default." |
| 21 | |
| 22 | read INPUT |
Brian Paul | 7bb7f97 | 2005-09-13 13:36:47 +0000 | [diff] [blame] | 23 | if [ "x${INPUT}" != "x" ] ; then |
Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 24 | INCLUDE_DIR=${INPUT} |
| 25 | fi |
| 26 | |
| 27 | echo |
| 28 | echo "Default directory for library files is:" ${LIB_DIR} |
| 29 | echo "Enter new directory or press <Enter> to accept this default." |
| 30 | |
| 31 | read INPUT |
Brian Paul | 7bb7f97 | 2005-09-13 13:36:47 +0000 | [diff] [blame] | 32 | if [ "x${INPUT}" != "x" ] ; then |
Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 33 | LIB_DIR=${INPUT} |
| 34 | fi |
| 35 | |
Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 36 | echo |
| 37 | echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL |
| 38 | echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR} |
| 39 | echo "Press <Enter> to continue, or <ctrl>-C to abort." |
| 40 | |
| 41 | read INPUT |
| 42 | |
Dave Airlie | a2990a9 | 2005-02-21 00:20:19 +0000 | [diff] [blame] | 43 | else |
| 44 | INCLUDE_DIR=$1/include |
| 45 | LIB_DIR=$1/lib |
| 46 | fi |
Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 47 | |
| 48 | # flags: |
| 49 | # -f = force |
Brian Paul | 7bb7f97 | 2005-09-13 13:36:47 +0000 | [diff] [blame] | 50 | # -d = preserve symlinks (does not work on BSD) |
| 51 | |
| 52 | if [ `uname` = "FreeBSD" ] ; then |
| 53 | CP_FLAGS="-f" |
Brian Paul | 413a49c | 2006-01-04 20:06:13 +0000 | [diff] [blame] | 54 | elif [ `uname` = "Darwin" ] ; then |
| 55 | CP_FLAGS="-f" |
Brian Paul | a5033a0 | 2006-02-14 14:57:04 +0000 | [diff] [blame] | 56 | elif [ `uname` = "AIX" ] ; then |
| 57 | CP_FLAGS="-fh" |
Brian Paul | 7bb7f97 | 2005-09-13 13:36:47 +0000 | [diff] [blame] | 58 | else |
| 59 | CP_FLAGS="-fd" |
| 60 | fi |
| 61 | |
Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 62 | |
| 63 | set -v |
| 64 | |
Adam Jackson | 3775b56 | 2006-08-10 20:24:50 +0000 | [diff] [blame] | 65 | mkdir -p ${INCLUDE_DIR} |
| 66 | mkdir -p ${INCLUDE_DIR}/GL |
| 67 | # NOT YET: mkdir -p ${INCLUDE_DIR}/GLES |
| 68 | mkdir -p ${LIB_DIR} |
Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 69 | cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL |
Brian Paul | 30cc822 | 2006-01-04 20:10:16 +0000 | [diff] [blame] | 70 | cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL |
Brian Paul | 7bb7f97 | 2005-09-13 13:36:47 +0000 | [diff] [blame] | 71 | # NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES |
| 72 | cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR} |
Brian Paul | d8944fb | 2004-03-26 15:19:53 +0000 | [diff] [blame] | 73 | |
| 74 | echo "Done." |