xref: /haiku/configure (revision c4786ea6c4d0a544cce35184735b81fd4d986b0f)
152a38012Sejakowatz#!/bin/sh
252a38012Sejakowatz#
3022fa244SIngo Weinhold# configure [ --floppy <floppy location> ]
452a38012Sejakowatz#
552a38012Sejakowatz# No parameters for now.
652a38012Sejakowatz
7022fa244SIngo Weinhold# usage
8022fa244SIngo Weinhold#
9022fa244SIngo Weinhold# Prints usage.
10022fa244SIngo Weinhold#
11022fa244SIngo Weinholdusage()
12022fa244SIngo Weinhold{
13022fa244SIngo Weinhold	cat << EOF
14022fa244SIngo Weinhold
15022fa244SIngo WeinholdUsage: $0 <options>
16022fa244SIngo Weinholdoptions:
17022fa244SIngo Weinhold  --floppy <floppy location>    Specifies the location of the floppy
18022fa244SIngo Weinhold                                (device or image).
19*c4786ea6Slillo  --debug                       Activates bochs serial debug emulation.
20022fa244SIngo Weinhold  --help                        Prints out this help.
21022fa244SIngo WeinholdEOF
22022fa244SIngo Weinhold}
23022fa244SIngo Weinhold
24022fa244SIngo Weinhold# assertparam
25022fa244SIngo Weinhold#
26022fa244SIngo Weinhold# Checks whether at least one parameter is left.
27022fa244SIngo Weinhold#
28022fa244SIngo Weinholdassertparam()
29022fa244SIngo Weinhold{
30022fa244SIngo Weinhold	if [ $2 \< 2 ]; then
31022fa244SIngo Weinhold		echo $0: \`$1\': Parameter expected.
32022fa244SIngo Weinhold		exit 1
33022fa244SIngo Weinhold	fi
34022fa244SIngo Weinhold}
35022fa244SIngo Weinhold
36022fa244SIngo Weinhold# default parameter values
37022fa244SIngo Weinhold#
3852a38012Sejakowatzplatform=`uname`
39022fa244SIngo Weinholdfloppy=
40*c4786ea6Slillodebug=0
41022fa244SIngo Weinhold
42022fa244SIngo Weinhold# parse parameters
43022fa244SIngo Weinhold#
44022fa244SIngo Weinholdwhile [ $# \> 0 ] ; do
45022fa244SIngo Weinhold	case "$1" in
46022fa244SIngo Weinhold		--floppy)		assertparam "$1" $#; floppy=$2; shift 2;;
47*c4786ea6Slillo		--debug)		debug=1; shift 1;;
48022fa244SIngo Weinhold		--help | -h)	usage; exit 0;;
49022fa244SIngo Weinhold		*)				echo Invalid argument: \`$1\'; exit 1;;
50022fa244SIngo Weinhold	esac
51022fa244SIngo Weinholddone
52022fa244SIngo Weinhold
53022fa244SIngo Weinhold# check parameters
54022fa244SIngo Weinhold#
55022fa244SIngo Weinholdif [ -n "$floppy" ]; then
56022fa244SIngo Weinhold	case "$floppy" in
57022fa244SIngo Weinhold		/*)	;;
58022fa244SIngo Weinhold		*)	echo "Warning: non-absolute floppy path. Parameter ignored.";
59022fa244SIngo Weinhold			floppy=;;
60022fa244SIngo Weinhold	esac
61022fa244SIngo Weinholdfi
6252a38012Sejakowatz
6352a38012Sejakowatz# BeOS
6452a38012Sejakowatzif [ "${platform}" == "BeOS" ] ; then
6552a38012Sejakowatz	# GGC_PATH
6652a38012Sejakowatz	if [ "x${GCC_PATH}" == "x" ] ; then
6752a38012Sejakowatz		gcclib=`gcc -print-libgcc-file-name`
6852a38012Sejakowatz		GCC_PATH=`dirname ${gcclib}`
6952a38012Sejakowatz	fi
7052a38012Sejakowatz
7152a38012Sejakowatz# Linux
7252a38012Sejakowatzelse if [ "${platform}" == "Linux" ] ; then
7352a38012Sejakowatz	# GGC_PATH
7452a38012Sejakowatz	if [ "x${GCC_PATH}" == "x" ] ; then
7552a38012Sejakowatz		gcclib=`gcc -print-libgcc-file-name`
7652a38012Sejakowatz		GCC_PATH=`dirname ${gcclib}`
7752a38012Sejakowatz	fi
7852a38012Sejakowatz
7952a38012Sejakowatz# Unknown platform
8052a38012Sejakowatzelse
8152a38012Sejakowatz	echo Unsupported platform: ${platform}
8252a38012Sejakowatz	exit 1
8352a38012Sejakowatzfi; fi
8452a38012Sejakowatz
8552a38012Sejakowatz# Generate BuildConfig
8652a38012Sejakowatzcat << EOF > BuildConfig
8752a38012Sejakowatz# BuildConfig
8852a38012Sejakowatz# Note: This file has been automatically generated by configure.
8952a38012Sejakowatz
90022fa244SIngo WeinholdFLOPPY_PATH	= "$floppy" ;
9152a38012SejakowatzGCC_PATH	= ${GCC_PATH} ;
9252a38012SejakowatzEOF
93*c4786ea6Slillo
94*c4786ea6Slillo# Generate bochs debug emulation hack header
95*c4786ea6Slillocat << EOF > headers/private/kernel/arch/bochs_hack.h
96*c4786ea6Slillo// Bochs serial debug emulation hack definition
97*c4786ea6Slillo// Note: This file has been automatically generated by configure.
98*c4786ea6Slillo
99*c4786ea6Slillo#define BOCHS_E9_HACK    $debug
100*c4786ea6SlilloEOF
101*c4786ea6Slillo
102