⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysspec.pl

📁 mini http server,可以集成嵌入到程序中,实现简单的web功能
💻 PL
字号:
#!/usr/bin/perl

#*____________________________________________________________________________*\
#*
#
# Copyright (c) 1997-2003 John Roy, Holger Zimmermann. All rights reserved.
#
# These sources, libraries and applications are
# FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
# as long as the following conditions are adhered to.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer. 
#
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
#
# 3. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission. 
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHORS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
#
#*____________________________________________________________________________*|
#*
#* $Source: /cvsroot/pi3web/Pi3Web_200/Source/Scripts/sysspec.pl,v $
#* $Date: 2003/05/13 18:42:18 $
#*
# Description:
#	Generate sysspecfile
#
#*____________________________________________________________________________*/

#/*___________________________________________________________________________*\
# Global declarations:
#\*___________________________________________________________________________*/

$_=$0; s/sysspec\.pl//i; $scriptdir=$_;
$sysspecfile=$scriptdir.'../sysspec.hh';
$_=`uname -s`.`uname -r`; s/\s//g; $os=$_;
$machine=`uname -m`;
$config_os='';
$config_os_flavor='';
$config_machine='';

#
# commands for the native shells
#
$cmd_seperator=';';
$cmd_cp='cp ';
$cmd_rm='rm -f ';
$cmd_perl='perl ';

#
# Check operating system
#
if ( $os =~ /[L|l]inux*/ )
	{
	$config_os='CONFIG_OS_LINUX';
	$config_os_flavor='POSIX';
	}
elsif ( $os =~ /SunOS5.*/ )
	{
	$config_os='CONFIG_OS_SOLARIS';
	$config_os_flavor='POSIX';
	}
elsif ( $os =~ /IRIX5.*/ )
	{
	$config_os='CONFIG_OS_IRIX5';
	$config_os_flavor='POSIX';
	}
elsif ( $os =~ /HP-UXB.9.*/ || $os =~ /HP-UXB.10.*/ )
	{
	$config_os='CONFIG_OS_HP';
	$config_os_flavor='POSIX';
	}
elsif ( $os =~ /Windows_NT*/ || $os =~ /Windows_95*/ || $os =~ /CYGWIN32_95*/)
	{
	$config_os='CONFIG_OS_WIN32';
	$config_os_flavor='WIN32';
	}
else
	{ print "\n*** Unsupported operating system $os ***\n"; exit -1; };

#
# Check machine
#
if ( $machine =~ /[i3-6|x]86*/ )
	{ $config_machine=CONFIG_MACHINE_I386; }
elsif( $machine =~ /sun4.*/ )
	{ $config_machine=CONFIG_MACHINE_SPARC; }
elsif( $machine =~ /IP*/ )
	{ $config_machine=CONFIG_MACHINE_IP; }
elsif( $machine =~ /9000\/*/ )
	{ $config_machine=CONFIG_MACHINE_HP; }
else
	{ print "\n*** Unsupported processor: $machine ***\n"; exit -1; };

#
# Generate platform/sysspec.h
#
open( SF, ">".$sysspecfile ) || die "Couldn't open file $sysspecfile\n";
print SF "/*\n" || die "Couldn't write to file $sysspecfile\n";
print SF ' *** DO NOT MODIFY: AUTOMATICALLY GENERATED FILE ***'."\n";
print SF ' */'."\n";
print SF "\n";
print SF '#ifndef SYSSPEC_H_'."\n";
print SF '#define SYSSPEC_H_'."\n";
print SF "\n";
print SF '#define '.$config_os."\n";
print SF '#define '.$config_machine."\n";
print SF "\n";
print SF '#endif /* SYSSPEC_H_ */'."\n";
print SF "\n";
print SF "\n";
close( SF );


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -