blob: 1e24c05cad77ede37fefcbf0f0afeb46210743bb [file] [log] [blame]
Brian Pauld8944fb2004-03-26 15:19:53 +00001#!/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
10TOP=.
11
12INCLUDE_DIR="/usr/local/include"
13LIB_DIR="/usr/local/lib"
14
Brian Paul7bb7f972005-09-13 13:36:47 +000015if [ "x$#" = "x0" ] ; then
Brian Pauld8944fb2004-03-26 15:19:53 +000016echo
17echo "***** Mesa installation - You may need root privileges to do this *****"
18echo
19echo "Default directory for header files is:" ${INCLUDE_DIR}
20echo "Enter new directory or press <Enter> to accept this default."
21
22read INPUT
Brian Paul7bb7f972005-09-13 13:36:47 +000023if [ "x${INPUT}" != "x" ] ; then
Brian Pauld8944fb2004-03-26 15:19:53 +000024 INCLUDE_DIR=${INPUT}
25fi
26
27echo
28echo "Default directory for library files is:" ${LIB_DIR}
29echo "Enter new directory or press <Enter> to accept this default."
30
31read INPUT
Brian Paul7bb7f972005-09-13 13:36:47 +000032if [ "x${INPUT}" != "x" ] ; then
Brian Pauld8944fb2004-03-26 15:19:53 +000033 LIB_DIR=${INPUT}
34fi
35
Brian Pauld8944fb2004-03-26 15:19:53 +000036echo
37echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL
38echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR}
39echo "Press <Enter> to continue, or <ctrl>-C to abort."
40
41read INPUT
42
Dave Airliea2990a92005-02-21 00:20:19 +000043else
44INCLUDE_DIR=$1/include
45LIB_DIR=$1/lib
46fi
Brian Pauld8944fb2004-03-26 15:19:53 +000047
48# flags:
49# -f = force
Brian Paul7bb7f972005-09-13 13:36:47 +000050# -d = preserve symlinks (does not work on BSD)
51
52if [ `uname` = "FreeBSD" ] ; then
53 CP_FLAGS="-f"
Brian Paul413a49c2006-01-04 20:06:13 +000054elif [ `uname` = "Darwin" ] ; then
55 CP_FLAGS="-f"
Brian Paula5033a02006-02-14 14:57:04 +000056elif [ `uname` = "AIX" ] ; then
57 CP_FLAGS="-fh"
Brian Paul7bb7f972005-09-13 13:36:47 +000058else
59 CP_FLAGS="-fd"
60fi
61
Brian Pauld8944fb2004-03-26 15:19:53 +000062
63set -v
64
Adam Jackson3775b562006-08-10 20:24:50 +000065mkdir -p ${INCLUDE_DIR}
66mkdir -p ${INCLUDE_DIR}/GL
67# NOT YET: mkdir -p ${INCLUDE_DIR}/GLES
68mkdir -p ${LIB_DIR}
Brian Pauld8944fb2004-03-26 15:19:53 +000069cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL
Brian Paul30cc8222006-01-04 20:10:16 +000070cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL
Brian Paul7bb7f972005-09-13 13:36:47 +000071# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
72cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR}
Brian Pauld8944fb2004-03-26 15:19:53 +000073
74echo "Done."