Changeset - r22059:3d901781f7f2
[Not reviewed]
master
0 1 0
planetmaker - 10 years ago 2015-04-11 10:25:36
planetmaker@openttd.org
(svn r27223) -Add [FS#6274]: Support for DragonflyBSD (AMDmi3)
1 file changed with 47 insertions and 45 deletions:
config.lib
47
45
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -523,16 +523,16 @@ check_params() {
 
	fi
 
	if [ "$endian" = "PREPROCESSOR" ] && [ "$os" != "OSX" ]; then
 
		log 1 "configure: error: invalid option --endian=$endian"
 
		log 1 " PREPROCESSOR is only available for OSX"
 
		exit 1
 
	fi
 
	# OS only allows DETECT, UNIX, OSX, FREEBSD, OPENBSD, MORPHOS, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP
 
	if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP)$'`" ]; then
 
	# OS only allows DETECT, UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP
 
	if [ -z "`echo $os | egrep '^(DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP)$'`" ]; then
 
		log 1 "configure: error: invalid option --os=$os"
 
		log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP]"
 
		log 1 " Available options are: --os=[DETECT|UNIX|OSX|FREEBSD|DRAGONFLY|OPENBSD|NETBSD|HPUX|MORPHOS|BEOS|HAIKU|SUNOS|CYGWIN|MINGW|OS2|DOS|WINCE|PSP]"
 
		exit 1
 
	fi
 
	# cpu_type can be either 32 or 64
 
	if [ -z "`echo $cpu_type | egrep '^(32|64|DETECT)$'`" ]; then
 
		log 1 "configure: error: invalid option --cpu-type=$cpu_type"
 
		log 1 " Available options are: --cpu-type[=DETECT|32|64]"
 
@@ -1051,23 +1051,23 @@ check_params() {
 
		log 1 "WARNING: USE WITH CAUTION!"
 

	
 
		sleep 5
 
	fi
 

	
 
	if [ "$doc_dir" = "1" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			doc_dir="share/doc/openttd"
 
		else
 
			doc_dir="$data_dir/docs"
 
		fi
 
	else
 
		doc_dir="`echo $doc_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
 
	fi
 

	
 
	if [ "$icon_theme_dir" = "1" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			icon_theme_dir="share/icons/hicolor"
 
		else
 
			icon_theme_dir=""
 
		fi
 
	else
 
		icon_theme_dir="`echo $icon_theme_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
 
@@ -1095,24 +1095,24 @@ check_params() {
 
	else
 
		shared_dir="`echo $shared_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
 
	fi
 

	
 
	if [ "$man_dir" = "1" ]; then
 
		# add manpage on UNIX systems
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OSX" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OSX" ]; then
 
			man_dir="share/man/man6"
 
		else
 
			man_dir=""
 
		fi
 
	else
 
		man_dir="`echo $man_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
 
	fi
 

	
 
	if [ "$menu_dir" = "1" ]; then
 
		# add a freedesktop menu item only for some UNIX systems
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			menu_dir="share/applications"
 
		else
 
			menu_dir=""
 
		fi
 
	else
 
		menu_dir="`echo $menu_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
 
@@ -1535,13 +1535,13 @@ make_cflags_and_ldflags() {
 
			if [ $cc_version -ge 47 ]; then
 
				CFLAGS="$CFLAGS -mno-ms-bitfields"
 
			fi
 
		fi
 
	fi
 

	
 
	if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
 
	if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
 
		LIBS="$LIBS -lpthread"
 
	fi
 

	
 
	if [ "$os" != "CYGWIN" ] && [ "$os" != "HAIKU" ] && [ "$os" != "MINGW" ] && [ "$os" != "DOS" ] && [ "$os" != "WINCE" ]; then
 
		LIBS="$LIBS -lc"
 
	fi
 
@@ -1607,13 +1607,13 @@ make_cflags_and_ldflags() {
 

	
 
	if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ]; then
 
		LIBS="$LIBS -lmidi -lbe"
 
	fi
 

	
 
	# Most targets act like UNIX, just with some additions
 
	if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
 
	if [ "$os" = "BEOS" ] || [ "$os" = "HAIKU" ] || [ "$os" = "OSX" ] || [ "$os" = "MORPHOS" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "DRAGONFLY" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OS2" ]; then
 
		CFLAGS="$CFLAGS -DUNIX"
 
	fi
 
	# And others like Windows
 
	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
 
		CFLAGS="$CFLAGS -DWIN"
 
	fi
 
@@ -2265,58 +2265,60 @@ detect_awk() {
 

	
 
	log 1 "checking awk... $awk"
 
}
 

	
 
detect_os() {
 
	if [ "$os" = "DETECT" ]; then
 
		# Detect UNIX, OSX, FREEBSD, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP
 
		# Detect UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, HPUX, MORPHOS, BEOS, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP
 

	
 
		# Try first via dumpmachine, then via uname
 
		os=`echo "$host" | tr '[A-Z]' '[a-z]' | $awk '
 
					/linux/        { print "UNIX";    exit}
 
					/darwin/       { print "OSX";     exit}
 
					/freebsd/      { print "FREEBSD"; exit}
 
					/openbsd/      { print "OPENBSD"; exit}
 
					/netbsd/       { print "NETBSD";  exit}
 
					/hp-ux/        { print "HPUX";    exit}
 
					/morphos/      { print "MORPHOS"; exit}
 
					/beos/         { print "BEOS";    exit}
 
					/haiku/        { print "HAIKU";   exit}
 
					/sunos/        { print "SUNOS";   exit}
 
					/solaris/      { print "SUNOS";   exit}
 
					/cygwin/       { print "CYGWIN";  exit}
 
					/mingw/        { print "MINGW";   exit}
 
					/os2/          { print "OS2";     exit}
 
					/dos/          { print "DOS";     exit}
 
					/wince/        { print "WINCE";   exit}
 
					/psp/          { print "PSP";     exit}
 
					/linux/        { print "UNIX";      exit}
 
					/darwin/       { print "OSX";       exit}
 
					/freebsd/      { print "FREEBSD";   exit}
 
					/dragonfly/    { print "DRAGONFLY"; exit}
 
					/openbsd/      { print "OPENBSD";   exit}
 
					/netbsd/       { print "NETBSD";    exit}
 
					/hp-ux/        { print "HPUX";      exit}
 
					/morphos/      { print "MORPHOS";   exit}
 
					/beos/         { print "BEOS";      exit}
 
					/haiku/        { print "HAIKU";     exit}
 
					/sunos/        { print "SUNOS";     exit}
 
					/solaris/      { print "SUNOS";     exit}
 
					/cygwin/       { print "CYGWIN";    exit}
 
					/mingw/        { print "MINGW";     exit}
 
					/os2/          { print "OS2";       exit}
 
					/dos/          { print "DOS";       exit}
 
					/wince/        { print "WINCE";     exit}
 
					/psp/          { print "PSP";       exit}
 
		'`
 

	
 
		if [ -z "$os" ]; then
 
			os=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | $awk '
 
					/linux/        { print "UNIX";    exit}
 
					/darwin/       { print "OSX";     exit}
 
					/freebsd/      { print "FREEBSD"; exit}
 
					/openbsd/      { print "OPENBSD"; exit}
 
					/netbsd/       { print "NETBSD";  exit}
 
					/hp-ux/        { print "HPUX";    exit}
 
					/morphos/      { print "MORPHOS"; exit}
 
					/beos/         { print "BEOS";    exit}
 
					/haiku/        { print "HAIKU";   exit}
 
					/sunos/        { print "SUNOS";   exit}
 
					/cygwin/       { print "CYGWIN";  exit}
 
					/mingw/        { print "MINGW";   exit}
 
					/os\/2/        { print "OS2";     exit}
 
					/gnu/          { print "UNIX";    exit}
 
					/linux/        { print "UNIX";      exit}
 
					/darwin/       { print "OSX";       exit}
 
					/freebsd/      { print "FREEBSD";   exit}
 
					/dragonfly/    { print "DRAGONFLY"; exit}
 
					/openbsd/      { print "OPENBSD";   exit}
 
					/netbsd/       { print "NETBSD";    exit}
 
					/hp-ux/        { print "HPUX";      exit}
 
					/morphos/      { print "MORPHOS";   exit}
 
					/beos/         { print "BEOS";      exit}
 
					/haiku/        { print "HAIKU";     exit}
 
					/sunos/        { print "SUNOS";     exit}
 
					/cygwin/       { print "CYGWIN";    exit}
 
					/mingw/        { print "MINGW";     exit}
 
					/os\/2/        { print "OS2";       exit}
 
					/gnu/          { print "UNIX";      exit}
 
			'`
 
		fi
 

	
 
		if [ -z "$os" ]; then
 
			log 1 "detecting OS... none detected"
 
			log 1 "I couldn't detect your OS. Please use --os=OS to force one"
 
			log 1 "Allowed values are: UNIX, OSX, FREEBSD, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP"
 
			log 1 "Allowed values are: UNIX, OSX, FREEBSD, DRAGONFLY, OPENBSD, NETBSD, MORPHOS, HPUX, BEOS, HAIKU, SUNOS, CYGWIN, MINGW, OS2, DOS, WINCE, and PSP"
 
			exit 1
 
		fi
 

	
 
		log 1 "detecting OS... $os"
 
	else
 
		log 1 "forcing OS... $os"
 
@@ -3589,15 +3591,15 @@ showhelp() {
 
	echo "                                 on HOST [BUILD]"
 
	echo "  --windres=WINDRES              the windres to use [HOST-windres]"
 
	echo "  --strip=STRIP                  the strip to use [HOST-strip]"
 
	echo "  --awk=AWK                      the awk to use in configure [awk]"
 
	echo "  --lipo=LIPO                    the lipo to use (OSX ONLY) [HOST-lipo]"
 
	echo "  --os=OS                        the OS we are compiling for [DETECT]"
 
	echo "                                 DETECT/UNIX/OSX/FREEBSD/OPENBSD/NETBSD/"
 
	echo "                                 MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/MINGW/OS2/"
 
	echo "                                 DOS/WINCE/PSP/HAIKU"
 
	echo "                                 DETECT/UNIX/OSX/FREEBSD/DRAGONFLY/OPENBSD/"
 
	echo "                                 NETBSD/MORPHOS/HPUX/BEOS/SUNOS/CYGWIN/"
 
	echo "                                 MINGW/OS2/DOS/WINCE/PSP/HAIKU"
 
	echo "  --endian=ENDIAN                set the endian of the HOST (AUTO/LE/BE)"
 
	echo ""
 
	echo "Paths:"
 
	echo "  --prefix-dir=dir               specifies the prefix for all installed"
 
	echo "                                 files [/usr/local]"
 
	echo "  --binary-dir=dir               location of the binary. Will be prefixed"
0 comments (0 inline, 0 general)