xref: /haiku/data/system/boot/SetupEnvironment (revision caed67a8cba83913b9c21ac2b06ebc6bd1cb3111)
1#
2# First we set up a bunch of environment variables that we want everyone
3# to inherit
4#
5
6export HOME=/boot/home
7
8BUILDHOME=/boot/system/develop
9
10case `uname -m` in
11BePC|Intel|unknown)
12	BE_HOST_CPU=x86
13	;;
14BeMac|BeBox)
15	BE_HOST_CPU=ppc
16	;;
17*)
18	BE_HOST_CPU=`uname -m`
19esac
20
21# not used by Haiku, but by (legacy) applications (e.g. Pe)
22BH=$BUILDHOME/headers
23BEINCLUDES="$BH;$BH/be;$BH/posix;$BH/glibc;$BH/cpp;$BH/be/app;$BH/be/device;$BH/be/interface;$BH/be/locale;$BH/be/media;$BH/be/midi;$BH/be/midi2;$BH/be/net;$BH/be/kernel;$BH/be/storage;$BH/be/support;$BH/be/game;$BH/be/opengl;$BH/be/drivers;$BH/gnu;$BH/be/mail;$BH/be/translation;$BH/be/devel;$BH/be/add-ons/graphics;$BH/be/be_apps/NetPositive;$BH/be/be_apps/Tracker"
24
25export BUILDHOME
26export BEINCLUDES
27export BE_HOST_CPU
28
29if [ "$SAFEMODE" != "yes" ]; then
30	export PATH=.:$HOME/config/non-packaged/bin:$HOME/config/bin:/boot/system/non-packaged/bin:/bin:/boot/system/apps:/boot/system/preferences
31	export LIBRARY_PATH="%A/lib:$HOME/config/non-packaged/lib:$HOME/config/lib:/boot/system/non-packaged/lib:/boot/system/lib"
32	export ADDON_PATH="%A/add-ons:$HOME/config/non-packaged/add-ons:$HOME/config/add-ons:/boot/system/non-packaged/add-ons:/boot/system/add-ons"
33else
34	export PATH=.:/bin:/boot/system/apps:/boot/system/preferences
35	export LIBRARY_PATH="%A/lib:/boot/system/lib"
36	export ADDON_PATH="%A/add-ons:/boot/system/add-ons"
37fi
38
39# Locale
40export LC_MESSAGES=`locale --message`
41export LC_NUMERIC=`locale --format`
42export LC_TIME=`locale --time`
43export LC_COLLATE=$LC_MESSAGES
44export LC_CTYPE=$LC_MESSAGES
45export LC_MONETARY=$LC_NUMERIC
46
47if [ "$SAFEMODE" != "yes" ]; then
48	if [ -f $HOME/config/settings/boot/UserSetupEnvironment ]; then
49     	. $HOME/config/settings/boot/UserSetupEnvironment
50	fi
51fi
52
53export USER=`id -un`
54export GROUP=`id -gn`
55
56#
57# Haiku setup for
58# XDG Base Directory Specification
59#
60# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
61
62# defaults to ~/.config
63export XDG_CONFIG_HOME="`finddir B_USER_SETTINGS_DIRECTORY`"
64
65# defaults to ~/.local/share
66export XDG_DATA_HOME="`finddir B_USER_NONPACKAGED_DATA_DIRECTORY`"
67
68# defaults to ~/.local/state
69export XDG_STATE_HOME="`finddir B_USER_VAR_DIRECTORY`"
70
71# defaults to /etc/xdg
72export XDG_CONFIG_DIRS="`finddir B_SYSTEM_SETTINGS_DIRECTORY`"
73# XXX: Should we add B_USER_ETC_DIRECTORY?
74
75# default to /usr/local/share/:/usr/share/
76export XDG_DATA_DIRS="`finddir B_SYSTEM_NONPACKAGED_DATA_DIRECTORY`:\
77`finddir B_SYSTEM_DATA_DIRECTORY`"
78
79# defaults to ~/.cache
80export XDG_CACHE_HOME="`finddir B_USER_CACHE_DIRECTORY`"
81
82# TODO:
83# This one is used for session stuff (sockets, pipes...)
84# It must be owned by the user, with permissions 0700.
85# It is supposed to be cleaned up on last log-out.
86# Apps will fall back to /tmp usually anyway.
87#export XDG_RUNTIME_DIR="`finddir B_USER_VAR_DIRECTORY`/tmp"
88