configure 1.24 KB
Newer Older
1
#!/bin/bash
2 3 4 5 6 7
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
8
# Copyright 2007 - 2016 Christopher Bratusek		#
9 10 11
#							#
#########################################################

12
shopt -s extglob
13
export TOP_PID=$$
14

15
MODULES=( base color messages checks substitute depends )
16

17 18
for mod in "${MODULES[@]}"; do
	source "${PWD}"/.configure/"${mod}"
19
done
20

21
rm -f "${PWD}"/.configure/results
22

23
xcount=0
24
while [[ ${xcount} -le $# ]]; do
25
	case ${1} in
26 27 28
		--prefix=* )		PREFIX="${1/*=}" ;;
		--pcdir=* )		PCDIR="${1/*=}" ;;
		--bindir=* )		BINDIR="${1/*=}" ;;
29 30
		--docdir=* )		DOCDIR="${1/*=}" ;;
		--mandir=* )		MANDIR="${1/*=}" ;;
31 32 33 34
		--girpath=* )		GIRPATH="${1/*=}" ;;
		--datadir=* )		DATADIR="${1/*=}" ;;
		--python=* )		PYTHON="${1/*=}" ;;
		--help )		MODE=help ;;
35
		--no-postinstall )	DISABLE_POSTINSTALL=1
36
					echo "DISABLE_POSTINSTALL=1" >> \
37
						"${PWD}"/.configure/results ;;
38 39
	esac
	shift
40
	xcount=$((xcount+1))
41
done
42
unset xcount
43

44
if [[ ${MODE} == help ]]; then
45
	help_message
46 47 48 49 50
else
	if [[ ${GIRPATH} == "" ]]; then
		missing_girpath_message ; exit 1
	fi

51
	start_message
52
	check_helper
53 54 55
	copy_in_files
	substitute_values
	end_message
56
	export_result
57
fi