├── njit-client-for-sysu-1.2.0_1ubuntu1-1_amd64.deb ├── Makefile.am ├── configure.ac ├── src ├── njit8021xclient.h ├── Makefile.am ├── njit8021xclient.c ├── fillmd5-libcrypto.c ├── debug.h ├── configure.ac ├── ip.c ├── config.h.in ├── main.c ├── missing ├── install-sh ├── depcomp ├── auth.c └── Makefile.in ├── .gitattributes ├── README.md ├── .gitignore ├── missing ├── install-sh ├── aclocal.m4 └── Makefile.in /njit-client-for-sysu-1.2.0_1ubuntu1-1_amd64.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhyaof/njit-client_for_sysu/HEAD/njit-client-for-sysu-1.2.0_1ubuntu1-1_amd64.deb -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = src 2 | dist_doc_DATA = 3 | dist_doc_DATA += ReadMe.html 4 | dist_doc_DATA += Install.html 5 | dist_doc_DATA += Documents.html 6 | dist_doc_DATA += License/gpl-3.0.txt 7 | 8 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | dnl Run autoreconf --install to generate ./configure from this file 2 | AC_INIT([njit8021xclient],[1.1]) 3 | AM_INIT_AUTOMAKE([-Wall -Werror foreign]) 4 | AC_CONFIG_SUBDIRS([src]) 5 | AC_CONFIG_FILES([ 6 | Makefile 7 | ]) 8 | AC_OUTPUT 9 | 10 | -------------------------------------------------------------------------------- /src/njit8021xclient.h: -------------------------------------------------------------------------------- 1 | #ifndef NJIT8021XCLIENT_H 2 | #define NJIT8021XCLIENT_H 3 | 4 | extern const struct GlobalConfig { 5 | const char *package_name; 6 | const char *package_version; 7 | const char *locale_dir; 8 | } g_config; 9 | 10 | #endif//NJIT8021XCLIENT_H 11 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | sbin_PROGRAMS = \ 3 | client \ 4 | $(NULL) 5 | client_SOURCES = \ 6 | main.c \ 7 | auth.c \ 8 | ip.c \ 9 | fillmd5-libcrypto.c \ 10 | njit8021xclient.c \ 11 | njit8021xclient.h \ 12 | debug.h \ 13 | $(NULL) 14 | CCOPT = $(V_CCOPT) 15 | DEFS = $(V_DEFS) 16 | INCLS = $(V_INCLS) 17 | client_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) 18 | client_CFLAGS += $(libcrypto_CFLAGS) 19 | client_LDADD = $(LBL_LIBS) 20 | client_LDADD += $(libcrypto_LIBS) 21 | 22 | -------------------------------------------------------------------------------- /src/njit8021xclient.c: -------------------------------------------------------------------------------- 1 | #if HAVE_CONFIG_H 2 | #include "config.h" 3 | #endif 4 | 5 | #ifndef PACKAGE_NAME 6 | #define PACKAGE_NAME "" 7 | #endif 8 | 9 | #ifndef PACKAGE_VERSION 10 | #define PACKAGE_VERSION "" 11 | #endif 12 | 13 | #ifndef LOCALEDIR 14 | #define LOCALEDIR "/usr/local/share/locale" 15 | #endif 16 | 17 | #include "njit8021xclient.h" 18 | 19 | const struct GlobalConfig g_config = { 20 | .package_name = PACKAGE_NAME, 21 | .package_version = PACKAGE_VERSION, 22 | .locale_dir = LOCALEDIR, 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /src/fillmd5-libcrypto.c: -------------------------------------------------------------------------------- 1 | /* File: 2 | * --------------- 3 | * 调用openssl提供的MD5函数 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | 13 | void FillMD5Area(uint8_t digest[], uint8_t id, const char passwd[], const uint8_t srcMD5[]) 14 | { 15 | uint8_t msgbuf[128]; // msgbuf = ‘id‘ + ‘passwd’ + ‘srcMD5’ 16 | size_t msglen; 17 | size_t passlen; 18 | 19 | passlen = strlen(passwd); 20 | msglen = 1 + passlen + 16; 21 | assert(sizeof(msgbuf) >= msglen); 22 | 23 | msgbuf[0] = id; 24 | memcpy(msgbuf+1, passwd, passlen); 25 | memcpy(msgbuf+1+passlen, srcMD5, 16); 26 | 27 | (void) MD5(msgbuf, msglen, digest); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/debug.h: -------------------------------------------------------------------------------- 1 | /* File: debug.h 2 | * ------------- 3 | * 定义少量用于调试的宏函数 4 | * 5 | */ 6 | 7 | #ifndef DEBUG_H 8 | #define DEBUG_H 9 | 10 | /** 11 | * Macro: DPRINTF() 12 | * 13 | * Usage: 调用格式与printf()一致,支持变长参数表,例子如下: 14 | * 15 | * #include "debug.h" 16 | * ... 17 | * int errcode; 18 | * char message[] = "xxx failed!"; 19 | * ... 20 | * DPRINTF("Debug message: errcode=%d\n", errcode); 21 | * DPRINTF("Debug message: $s\n", message); 22 | * exit(errcode); 23 | * 24 | * 在发布版中定义NDEBUG宏可以清除所有DPRINTF()信息 25 | * 注:宏NDEBUG源自C语言惯例 26 | * 27 | */ 28 | #ifdef NDEBUG 29 | # define DPRINTF(...) 30 | #else 31 | # include // 导入函数原型fprintf(stderr,"%format",...) 32 | # define DPRINTF(...) fprintf(stderr, __VA_ARGS__) 33 | #endif 34 | 35 | #endif // DEBUG_H 36 | -------------------------------------------------------------------------------- /src/configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT([njit8021xclient],[1.0],[njit8021xclient@googlegroups.com],[],[https://github.com/liuqun/njit8021xclient]) 2 | 3 | AC_MSG_CHECKING([program prefix for $PACKAGE_NAME]); 4 | if test "x$program_prefix" = "x" || test $program_prefix = "NONE" ; then 5 | dnl 可执行文件前缀默认值 6 | program_prefix="njit-" 7 | fi 8 | AC_MSG_RESULT([$program_prefix]) 9 | 10 | AM_INIT_AUTOMAKE([-Wall -Werror foreign]) 11 | AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS) 12 | AC_PROG_CC 13 | AC_LBL_C_INIT(V_CCOPT, V_INCLS) 14 | AC_LBL_C_INLINE 15 | AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) 16 | AC_SUBST(V_CCOPT) 17 | AC_SUBST(V_DEFS) 18 | AC_SUBST(V_GROUP) 19 | AC_SUBST(V_INCLS) 20 | AC_SUBST(V_PCAPDEP) 21 | PKG_CHECK_MODULES([libcrypto], [libcrypto]) 22 | AC_CONFIG_HEADER([config.h]) 23 | AC_CONFIG_FILES([ 24 | Makefile 25 | ]) 26 | AC_OUTPUT 27 | 28 | -------------------------------------------------------------------------------- /src/ip.c: -------------------------------------------------------------------------------- 1 | /* File: ip.c 2 | * ---------- 3 | * 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | void GetIpFromDevice(uint8_t ip[4], const char DeviceName[]) 19 | { 20 | int fd; 21 | struct ifreq ifr; 22 | 23 | assert(strlen(DeviceName) <= IFNAMSIZ); 24 | 25 | fd = socket(AF_INET, SOCK_DGRAM, 0); 26 | assert(fd>0); 27 | 28 | strncpy(ifr.ifr_name, DeviceName, IFNAMSIZ); 29 | ifr.ifr_addr.sa_family = AF_INET; 30 | if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) 31 | { 32 | struct sockaddr_in *p = (void*) &(ifr.ifr_addr); 33 | memcpy(ip, &(p->sin_addr), 4); 34 | } 35 | else 36 | { 37 | // 查询不到IP时默认填零处理 38 | memset(ip, 0x00, 4); 39 | } 40 | 41 | close(fd); 42 | return; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | njit-client_for_sysu 2 | ----- 3 | njit-client_for_sysu旨在为Linux或Openwrt环境提供H3C 802.1X认证客户端。 4 | 简介 5 | ----- 6 | 本项目解决了SYSU使用Linux或Openwrt登录认证问题。
经测试SYSU完美兼容,兼容明文传输密码以及md5密码加密。
兼容iNode PC V3.6(E6208)、iNode PC V5.0(E0101)和iNode PC V5.1。 7 | 安装 8 | ----- 9 | 从源码安装。先安装对应开发包。
10 | 对应Ubuntu/Debian的是:
11 | sudo apt-get install libpcap-dev libssl-dev
12 | 对应Fedora/Redhat的是:
13 | yum install libpcap-devel openssl-devel
14 | 从源码包开始编译客户端的命令为:
15 | tar xzf njit8021xlient-1.1.tar.gz
16 | cd njit8021xlient-1.1
17 | ./configure make
18 | 安装:
19 | make install
20 | 注1: 默认安装至/usr/local目录,需要root管理员权限。 21 | 使用方法 22 | ----- 23 | 通过命令行切换为root并运行njit-client程序:
24 | Ubuntu下命令格式为:
25 | sudo njit-client user_name password
26 | RedHat/Fedora下命令格式为:
27 | su -c "njit-client user_name password"
28 | 说明 29 | ----- 30 | 本项目基于刘群的njit-client开发,项目地址:https://github.com/liuqun/njit8021xclient 感谢@狼王弱爆了 为我们改写了其md5。md5参考自Maple的YaH3C。 -------------------------------------------------------------------------------- /src/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the `pcap_breakloop' function. */ 4 | #undef HAVE_PCAP_BREAKLOOP 5 | 6 | /* pcap_datalink_name_to_val() */ 7 | #undef HAVE_PCAP_DATALINK_NAME_TO_VAL 8 | 9 | /* pcap_datalink_val_to_description() */ 10 | #undef HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 11 | 12 | /* pcap_dump_ftell() */ 13 | #undef HAVE_PCAP_DUMP_FTELL 14 | 15 | /* pcap_list_datalinks() */ 16 | #undef HAVE_PCAP_LIST_DATALINKS 17 | 18 | /* pcap_set_datalink() */ 19 | #undef HAVE_PCAP_SET_DATALINK 20 | 21 | /* Define to 1 if you have the `pfopen' function. */ 22 | #undef HAVE_PFOPEN 23 | 24 | /* Name of package */ 25 | #undef PACKAGE 26 | 27 | /* Define to the address where bug reports for this package should be sent. */ 28 | #undef PACKAGE_BUGREPORT 29 | 30 | /* Define to the full name of this package. */ 31 | #undef PACKAGE_NAME 32 | 33 | /* Define to the full name and version of this package. */ 34 | #undef PACKAGE_STRING 35 | 36 | /* Define to the one symbol short name of this package. */ 37 | #undef PACKAGE_TARNAME 38 | 39 | /* Define to the home page for this package. */ 40 | #undef PACKAGE_URL 41 | 42 | /* Define to the version of this package. */ 43 | #undef PACKAGE_VERSION 44 | 45 | /* Version number of package */ 46 | #undef VERSION 47 | 48 | /* needed on HP-UX */ 49 | #undef _HPUX_SOURCE 50 | 51 | /* to handle Ultrix compilers that don't support const in prototypes */ 52 | #undef const 53 | 54 | /* Define as token for inline if inlining supported */ 55 | #undef inline 56 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | /* File: main.c 2 | * ------------ 3 | * 校园网802.1X客户端命令行 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | /* 子函数声明 */ 12 | int Authentication(const char *UserName, const char *Password, const char *DeviceName); 13 | 14 | 15 | /** 16 | * 函数:main() 17 | * 18 | * 检查程序的执行权限,检查命令行参数格式。 19 | * 允许的调用格式包括: 20 | * njit-client username password 21 | * njit-client username password eth0 22 | * njit-client username password eth1 23 | * 若没有从命令行指定网卡,则默认将使用eth0 24 | */ 25 | int main(int argc, char *argv[]) 26 | { 27 | char *UserName; 28 | char *Password; 29 | char *DeviceName; 30 | 31 | /* 检查当前是否具有root权限 */ 32 | if (getuid() != 0) { 33 | fprintf(stderr, "抱歉,运行本客户端程序需要root权限\n"); 34 | fprintf(stderr, "(RedHat/Fedora下使用su命令切换为root)\n"); 35 | fprintf(stderr, "(Ubuntu/Debian下在命令前添加sudo)\n"); 36 | exit(-1); 37 | } 38 | 39 | /* 检查命令行参数格式 */ 40 | if (argc<3 || argc>4) { 41 | fprintf(stderr, "命令行参数错误!\n"); 42 | fprintf(stderr, "正确的调用格式例子如下:\n"); 43 | fprintf(stderr, " %s username password\n", argv[0]); 44 | fprintf(stderr, " %s username password eth0\n", argv[0]); 45 | fprintf(stderr, " %s username password eth1\n", argv[0]); 46 | fprintf(stderr, "(注:若不指明网卡,默认情况下将使用eth0)\n"); 47 | exit(-1); 48 | } else if (argc == 4) { 49 | DeviceName = argv[3]; // 允许从命令行指定设备名 50 | } else { 51 | DeviceName = "eth0"; // 缺省情况下使用的设备 52 | } 53 | UserName = argv[1]; 54 | Password = argv[2]; 55 | 56 | /* 调用子函数完成802.1X认证 */ 57 | Authentication(UserName, Password, DeviceName); 58 | 59 | return (0); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 7 | # 2008, 2009 Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | if test $# -eq 0; then 29 | echo 1>&2 "Try \`$0 --help' for more information" 30 | exit 1 31 | fi 32 | 33 | run=: 34 | sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 35 | sed_minuso='s/.* -o \([^ ]*\).*/\1/p' 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case $1 in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | autom4te touch the output file, or create a stub one 81 | automake touch all \`Makefile.in' files 82 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 83 | flex create \`lex.yy.c', if possible, from existing .c 84 | help2man touch the output file 85 | lex create \`lex.yy.c', if possible, from existing .c 86 | makeinfo touch the output file 87 | tar try tar, gnutar, gtar, then tar without non-portable flags 88 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 89 | 90 | Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 91 | \`g' are ignored when checking the name. 92 | 93 | Send bug reports to ." 94 | exit $? 95 | ;; 96 | 97 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 98 | echo "missing $scriptversion (GNU Automake)" 99 | exit $? 100 | ;; 101 | 102 | -*) 103 | echo 1>&2 "$0: Unknown \`$1' option" 104 | echo 1>&2 "Try \`$0 --help' for more information" 105 | exit 1 106 | ;; 107 | 108 | esac 109 | 110 | # normalize program name to check for. 111 | program=`echo "$1" | sed ' 112 | s/^gnu-//; t 113 | s/^gnu//; t 114 | s/^g//; t'` 115 | 116 | # Now exit if we have it, but it failed. Also exit now if we 117 | # don't have it and --version was passed (most likely to detect 118 | # the program). This is about non-GNU programs, so use $1 not 119 | # $program. 120 | case $1 in 121 | lex*|yacc*) 122 | # Not GNU programs, they don't have --version. 123 | ;; 124 | 125 | tar*) 126 | if test -n "$run"; then 127 | echo 1>&2 "ERROR: \`tar' requires --run" 128 | exit 1 129 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 130 | exit 1 131 | fi 132 | ;; 133 | 134 | *) 135 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 136 | # We have it, but it failed. 137 | exit 1 138 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 139 | # Could not run --version or --help. This is probably someone 140 | # running `$TOOL --version' or `$TOOL --help' to check whether 141 | # $TOOL exists and not knowing $TOOL uses missing. 142 | exit 1 143 | fi 144 | ;; 145 | esac 146 | 147 | # If it does not exist, or fails to run (possibly an outdated version), 148 | # try to emulate it. 149 | case $program in 150 | aclocal*) 151 | echo 1>&2 "\ 152 | WARNING: \`$1' is $msg. You should only need it if 153 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 154 | to install the \`Automake' and \`Perl' packages. Grab them from 155 | any GNU archive site." 156 | touch aclocal.m4 157 | ;; 158 | 159 | autoconf*) 160 | echo 1>&2 "\ 161 | WARNING: \`$1' is $msg. You should only need it if 162 | you modified \`${configure_ac}'. You might want to install the 163 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 164 | archive site." 165 | touch configure 166 | ;; 167 | 168 | autoheader*) 169 | echo 1>&2 "\ 170 | WARNING: \`$1' is $msg. You should only need it if 171 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 172 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 173 | from any GNU archive site." 174 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 175 | test -z "$files" && files="config.h" 176 | touch_files= 177 | for f in $files; do 178 | case $f in 179 | *:*) touch_files="$touch_files "`echo "$f" | 180 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 181 | *) touch_files="$touch_files $f.in";; 182 | esac 183 | done 184 | touch $touch_files 185 | ;; 186 | 187 | automake*) 188 | echo 1>&2 "\ 189 | WARNING: \`$1' is $msg. You should only need it if 190 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 191 | You might want to install the \`Automake' and \`Perl' packages. 192 | Grab them from any GNU archive site." 193 | find . -type f -name Makefile.am -print | 194 | sed 's/\.am$/.in/' | 195 | while read f; do touch "$f"; done 196 | ;; 197 | 198 | autom4te*) 199 | echo 1>&2 "\ 200 | WARNING: \`$1' is needed, but is $msg. 201 | You might have modified some files without having the 202 | proper tools for further handling them. 203 | You can get \`$1' as part of \`Autoconf' from any GNU 204 | archive site." 205 | 206 | file=`echo "$*" | sed -n "$sed_output"` 207 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 208 | if test -f "$file"; then 209 | touch $file 210 | else 211 | test -z "$file" || exec >$file 212 | echo "#! /bin/sh" 213 | echo "# Created by GNU Automake missing as a replacement of" 214 | echo "# $ $@" 215 | echo "exit 0" 216 | chmod +x $file 217 | exit 1 218 | fi 219 | ;; 220 | 221 | bison*|yacc*) 222 | echo 1>&2 "\ 223 | WARNING: \`$1' $msg. You should only need it if 224 | you modified a \`.y' file. You may need the \`Bison' package 225 | in order for those modifications to take effect. You can get 226 | \`Bison' from any GNU archive site." 227 | rm -f y.tab.c y.tab.h 228 | if test $# -ne 1; then 229 | eval LASTARG="\${$#}" 230 | case $LASTARG in 231 | *.y) 232 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 233 | if test -f "$SRCFILE"; then 234 | cp "$SRCFILE" y.tab.c 235 | fi 236 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 237 | if test -f "$SRCFILE"; then 238 | cp "$SRCFILE" y.tab.h 239 | fi 240 | ;; 241 | esac 242 | fi 243 | if test ! -f y.tab.h; then 244 | echo >y.tab.h 245 | fi 246 | if test ! -f y.tab.c; then 247 | echo 'main() { return 0; }' >y.tab.c 248 | fi 249 | ;; 250 | 251 | lex*|flex*) 252 | echo 1>&2 "\ 253 | WARNING: \`$1' is $msg. You should only need it if 254 | you modified a \`.l' file. You may need the \`Flex' package 255 | in order for those modifications to take effect. You can get 256 | \`Flex' from any GNU archive site." 257 | rm -f lex.yy.c 258 | if test $# -ne 1; then 259 | eval LASTARG="\${$#}" 260 | case $LASTARG in 261 | *.l) 262 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 263 | if test -f "$SRCFILE"; then 264 | cp "$SRCFILE" lex.yy.c 265 | fi 266 | ;; 267 | esac 268 | fi 269 | if test ! -f lex.yy.c; then 270 | echo 'main() { return 0; }' >lex.yy.c 271 | fi 272 | ;; 273 | 274 | help2man*) 275 | echo 1>&2 "\ 276 | WARNING: \`$1' is $msg. You should only need it if 277 | you modified a dependency of a manual page. You may need the 278 | \`Help2man' package in order for those modifications to take 279 | effect. You can get \`Help2man' from any GNU archive site." 280 | 281 | file=`echo "$*" | sed -n "$sed_output"` 282 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 283 | if test -f "$file"; then 284 | touch $file 285 | else 286 | test -z "$file" || exec >$file 287 | echo ".ab help2man is required to generate this page" 288 | exit $? 289 | fi 290 | ;; 291 | 292 | makeinfo*) 293 | echo 1>&2 "\ 294 | WARNING: \`$1' is $msg. You should only need it if 295 | you modified a \`.texi' or \`.texinfo' file, or any other file 296 | indirectly affecting the aspect of the manual. The spurious 297 | call might also be the consequence of using a buggy \`make' (AIX, 298 | DU, IRIX). You might want to install the \`Texinfo' package or 299 | the \`GNU make' package. Grab either from any GNU archive site." 300 | # The file to touch is that specified with -o ... 301 | file=`echo "$*" | sed -n "$sed_output"` 302 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 303 | if test -z "$file"; then 304 | # ... or it is the one specified with @setfilename ... 305 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 306 | file=`sed -n ' 307 | /^@setfilename/{ 308 | s/.* \([^ ]*\) *$/\1/ 309 | p 310 | q 311 | }' $infile` 312 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 313 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 314 | fi 315 | # If the file does not exist, the user really needs makeinfo; 316 | # let's fail without touching anything. 317 | test -f $file || exit 1 318 | touch $file 319 | ;; 320 | 321 | tar*) 322 | shift 323 | 324 | # We have already tried tar in the generic part. 325 | # Look for gnutar/gtar before invocation to avoid ugly error 326 | # messages. 327 | if (gnutar --version > /dev/null 2>&1); then 328 | gnutar "$@" && exit 0 329 | fi 330 | if (gtar --version > /dev/null 2>&1); then 331 | gtar "$@" && exit 0 332 | fi 333 | firstarg="$1" 334 | if shift; then 335 | case $firstarg in 336 | *o*) 337 | firstarg=`echo "$firstarg" | sed s/o//` 338 | tar "$firstarg" "$@" && exit 0 339 | ;; 340 | esac 341 | case $firstarg in 342 | *h*) 343 | firstarg=`echo "$firstarg" | sed s/h//` 344 | tar "$firstarg" "$@" && exit 0 345 | ;; 346 | esac 347 | fi 348 | 349 | echo 1>&2 "\ 350 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 351 | You may want to install GNU tar or Free paxutils, or check the 352 | command line arguments." 353 | exit 1 354 | ;; 355 | 356 | *) 357 | echo 1>&2 "\ 358 | WARNING: \`$1' is needed, and is $msg. 359 | You might have modified some files without having the 360 | proper tools for further handling them. Check the \`README' file, 361 | it often tells you about the needed prerequisites for installing 362 | this package. You may also peek at any GNU archive site, in case 363 | some other package would contain this missing \`$1' program." 364 | exit 1 365 | ;; 366 | esac 367 | 368 | exit 0 369 | 370 | # Local variables: 371 | # eval: (add-hook 'write-file-hooks 'time-stamp) 372 | # time-stamp-start: "scriptversion=" 373 | # time-stamp-format: "%:y-%02m-%02d.%02H" 374 | # time-stamp-time-zone: "UTC" 375 | # time-stamp-end: "; # UTC" 376 | # End: 377 | -------------------------------------------------------------------------------- /src/missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 7 | # 2008, 2009 Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | if test $# -eq 0; then 29 | echo 1>&2 "Try \`$0 --help' for more information" 30 | exit 1 31 | fi 32 | 33 | run=: 34 | sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 35 | sed_minuso='s/.* -o \([^ ]*\).*/\1/p' 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case $1 in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | autom4te touch the output file, or create a stub one 81 | automake touch all \`Makefile.in' files 82 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 83 | flex create \`lex.yy.c', if possible, from existing .c 84 | help2man touch the output file 85 | lex create \`lex.yy.c', if possible, from existing .c 86 | makeinfo touch the output file 87 | tar try tar, gnutar, gtar, then tar without non-portable flags 88 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 89 | 90 | Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 91 | \`g' are ignored when checking the name. 92 | 93 | Send bug reports to ." 94 | exit $? 95 | ;; 96 | 97 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 98 | echo "missing $scriptversion (GNU Automake)" 99 | exit $? 100 | ;; 101 | 102 | -*) 103 | echo 1>&2 "$0: Unknown \`$1' option" 104 | echo 1>&2 "Try \`$0 --help' for more information" 105 | exit 1 106 | ;; 107 | 108 | esac 109 | 110 | # normalize program name to check for. 111 | program=`echo "$1" | sed ' 112 | s/^gnu-//; t 113 | s/^gnu//; t 114 | s/^g//; t'` 115 | 116 | # Now exit if we have it, but it failed. Also exit now if we 117 | # don't have it and --version was passed (most likely to detect 118 | # the program). This is about non-GNU programs, so use $1 not 119 | # $program. 120 | case $1 in 121 | lex*|yacc*) 122 | # Not GNU programs, they don't have --version. 123 | ;; 124 | 125 | tar*) 126 | if test -n "$run"; then 127 | echo 1>&2 "ERROR: \`tar' requires --run" 128 | exit 1 129 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 130 | exit 1 131 | fi 132 | ;; 133 | 134 | *) 135 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 136 | # We have it, but it failed. 137 | exit 1 138 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 139 | # Could not run --version or --help. This is probably someone 140 | # running `$TOOL --version' or `$TOOL --help' to check whether 141 | # $TOOL exists and not knowing $TOOL uses missing. 142 | exit 1 143 | fi 144 | ;; 145 | esac 146 | 147 | # If it does not exist, or fails to run (possibly an outdated version), 148 | # try to emulate it. 149 | case $program in 150 | aclocal*) 151 | echo 1>&2 "\ 152 | WARNING: \`$1' is $msg. You should only need it if 153 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 154 | to install the \`Automake' and \`Perl' packages. Grab them from 155 | any GNU archive site." 156 | touch aclocal.m4 157 | ;; 158 | 159 | autoconf*) 160 | echo 1>&2 "\ 161 | WARNING: \`$1' is $msg. You should only need it if 162 | you modified \`${configure_ac}'. You might want to install the 163 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 164 | archive site." 165 | touch configure 166 | ;; 167 | 168 | autoheader*) 169 | echo 1>&2 "\ 170 | WARNING: \`$1' is $msg. You should only need it if 171 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 172 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 173 | from any GNU archive site." 174 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 175 | test -z "$files" && files="config.h" 176 | touch_files= 177 | for f in $files; do 178 | case $f in 179 | *:*) touch_files="$touch_files "`echo "$f" | 180 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 181 | *) touch_files="$touch_files $f.in";; 182 | esac 183 | done 184 | touch $touch_files 185 | ;; 186 | 187 | automake*) 188 | echo 1>&2 "\ 189 | WARNING: \`$1' is $msg. You should only need it if 190 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 191 | You might want to install the \`Automake' and \`Perl' packages. 192 | Grab them from any GNU archive site." 193 | find . -type f -name Makefile.am -print | 194 | sed 's/\.am$/.in/' | 195 | while read f; do touch "$f"; done 196 | ;; 197 | 198 | autom4te*) 199 | echo 1>&2 "\ 200 | WARNING: \`$1' is needed, but is $msg. 201 | You might have modified some files without having the 202 | proper tools for further handling them. 203 | You can get \`$1' as part of \`Autoconf' from any GNU 204 | archive site." 205 | 206 | file=`echo "$*" | sed -n "$sed_output"` 207 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 208 | if test -f "$file"; then 209 | touch $file 210 | else 211 | test -z "$file" || exec >$file 212 | echo "#! /bin/sh" 213 | echo "# Created by GNU Automake missing as a replacement of" 214 | echo "# $ $@" 215 | echo "exit 0" 216 | chmod +x $file 217 | exit 1 218 | fi 219 | ;; 220 | 221 | bison*|yacc*) 222 | echo 1>&2 "\ 223 | WARNING: \`$1' $msg. You should only need it if 224 | you modified a \`.y' file. You may need the \`Bison' package 225 | in order for those modifications to take effect. You can get 226 | \`Bison' from any GNU archive site." 227 | rm -f y.tab.c y.tab.h 228 | if test $# -ne 1; then 229 | eval LASTARG="\${$#}" 230 | case $LASTARG in 231 | *.y) 232 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 233 | if test -f "$SRCFILE"; then 234 | cp "$SRCFILE" y.tab.c 235 | fi 236 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 237 | if test -f "$SRCFILE"; then 238 | cp "$SRCFILE" y.tab.h 239 | fi 240 | ;; 241 | esac 242 | fi 243 | if test ! -f y.tab.h; then 244 | echo >y.tab.h 245 | fi 246 | if test ! -f y.tab.c; then 247 | echo 'main() { return 0; }' >y.tab.c 248 | fi 249 | ;; 250 | 251 | lex*|flex*) 252 | echo 1>&2 "\ 253 | WARNING: \`$1' is $msg. You should only need it if 254 | you modified a \`.l' file. You may need the \`Flex' package 255 | in order for those modifications to take effect. You can get 256 | \`Flex' from any GNU archive site." 257 | rm -f lex.yy.c 258 | if test $# -ne 1; then 259 | eval LASTARG="\${$#}" 260 | case $LASTARG in 261 | *.l) 262 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 263 | if test -f "$SRCFILE"; then 264 | cp "$SRCFILE" lex.yy.c 265 | fi 266 | ;; 267 | esac 268 | fi 269 | if test ! -f lex.yy.c; then 270 | echo 'main() { return 0; }' >lex.yy.c 271 | fi 272 | ;; 273 | 274 | help2man*) 275 | echo 1>&2 "\ 276 | WARNING: \`$1' is $msg. You should only need it if 277 | you modified a dependency of a manual page. You may need the 278 | \`Help2man' package in order for those modifications to take 279 | effect. You can get \`Help2man' from any GNU archive site." 280 | 281 | file=`echo "$*" | sed -n "$sed_output"` 282 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 283 | if test -f "$file"; then 284 | touch $file 285 | else 286 | test -z "$file" || exec >$file 287 | echo ".ab help2man is required to generate this page" 288 | exit $? 289 | fi 290 | ;; 291 | 292 | makeinfo*) 293 | echo 1>&2 "\ 294 | WARNING: \`$1' is $msg. You should only need it if 295 | you modified a \`.texi' or \`.texinfo' file, or any other file 296 | indirectly affecting the aspect of the manual. The spurious 297 | call might also be the consequence of using a buggy \`make' (AIX, 298 | DU, IRIX). You might want to install the \`Texinfo' package or 299 | the \`GNU make' package. Grab either from any GNU archive site." 300 | # The file to touch is that specified with -o ... 301 | file=`echo "$*" | sed -n "$sed_output"` 302 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 303 | if test -z "$file"; then 304 | # ... or it is the one specified with @setfilename ... 305 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 306 | file=`sed -n ' 307 | /^@setfilename/{ 308 | s/.* \([^ ]*\) *$/\1/ 309 | p 310 | q 311 | }' $infile` 312 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 313 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 314 | fi 315 | # If the file does not exist, the user really needs makeinfo; 316 | # let's fail without touching anything. 317 | test -f $file || exit 1 318 | touch $file 319 | ;; 320 | 321 | tar*) 322 | shift 323 | 324 | # We have already tried tar in the generic part. 325 | # Look for gnutar/gtar before invocation to avoid ugly error 326 | # messages. 327 | if (gnutar --version > /dev/null 2>&1); then 328 | gnutar "$@" && exit 0 329 | fi 330 | if (gtar --version > /dev/null 2>&1); then 331 | gtar "$@" && exit 0 332 | fi 333 | firstarg="$1" 334 | if shift; then 335 | case $firstarg in 336 | *o*) 337 | firstarg=`echo "$firstarg" | sed s/o//` 338 | tar "$firstarg" "$@" && exit 0 339 | ;; 340 | esac 341 | case $firstarg in 342 | *h*) 343 | firstarg=`echo "$firstarg" | sed s/h//` 344 | tar "$firstarg" "$@" && exit 0 345 | ;; 346 | esac 347 | fi 348 | 349 | echo 1>&2 "\ 350 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 351 | You may want to install GNU tar or Free paxutils, or check the 352 | command line arguments." 353 | exit 1 354 | ;; 355 | 356 | *) 357 | echo 1>&2 "\ 358 | WARNING: \`$1' is needed, and is $msg. 359 | You might have modified some files without having the 360 | proper tools for further handling them. Check the \`README' file, 361 | it often tells you about the needed prerequisites for installing 362 | this package. You may also peek at any GNU archive site, in case 363 | some other package would contain this missing \`$1' program." 364 | exit 1 365 | ;; 366 | esac 367 | 368 | exit 0 369 | 370 | # Local variables: 371 | # eval: (add-hook 'write-file-hooks 'time-stamp) 372 | # time-stamp-start: "scriptversion=" 373 | # time-stamp-format: "%:y-%02m-%02d.%02H" 374 | # time-stamp-time-zone: "UTC" 375 | # time-stamp-end: "; # UTC" 376 | # End: 377 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. 43 | 44 | nl=' 45 | ' 46 | IFS=" "" $nl" 47 | 48 | # set DOITPROG to echo to test this script 49 | 50 | # Don't use :- since 4.3BSD and earlier shells don't like it. 51 | doit=${DOITPROG-} 52 | if test -z "$doit"; then 53 | doit_exec=exec 54 | else 55 | doit_exec=$doit 56 | fi 57 | 58 | # Put in absolute file names if you don't have them in your path; 59 | # or use environment vars. 60 | 61 | chgrpprog=${CHGRPPROG-chgrp} 62 | chmodprog=${CHMODPROG-chmod} 63 | chownprog=${CHOWNPROG-chown} 64 | cmpprog=${CMPPROG-cmp} 65 | cpprog=${CPPROG-cp} 66 | mkdirprog=${MKDIRPROG-mkdir} 67 | mvprog=${MVPROG-mv} 68 | rmprog=${RMPROG-rm} 69 | stripprog=${STRIPPROG-strip} 70 | 71 | posix_glob='?' 72 | initialize_posix_glob=' 73 | test "$posix_glob" != "?" || { 74 | if (set -f) 2>/dev/null; then 75 | posix_glob= 76 | else 77 | posix_glob=: 78 | fi 79 | } 80 | ' 81 | 82 | posix_mkdir= 83 | 84 | # Desired mode of installed file. 85 | mode=0755 86 | 87 | chgrpcmd= 88 | chmodcmd=$chmodprog 89 | chowncmd= 90 | mvcmd=$mvprog 91 | rmcmd="$rmprog -f" 92 | stripcmd= 93 | 94 | src= 95 | dst= 96 | dir_arg= 97 | dst_arg= 98 | 99 | copy_on_change=false 100 | no_target_directory= 101 | 102 | usage="\ 103 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 104 | or: $0 [OPTION]... SRCFILES... DIRECTORY 105 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 106 | or: $0 [OPTION]... -d DIRECTORIES... 107 | 108 | In the 1st form, copy SRCFILE to DSTFILE. 109 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 110 | In the 4th, create DIRECTORIES. 111 | 112 | Options: 113 | --help display this help and exit. 114 | --version display version info and exit. 115 | 116 | -c (ignored) 117 | -C install only if different (preserve the last data modification time) 118 | -d create directories instead of installing files. 119 | -g GROUP $chgrpprog installed files to GROUP. 120 | -m MODE $chmodprog installed files to MODE. 121 | -o USER $chownprog installed files to USER. 122 | -s $stripprog installed files. 123 | -t DIRECTORY install into DIRECTORY. 124 | -T report an error if DSTFILE is a directory. 125 | 126 | Environment variables override the default commands: 127 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 128 | RMPROG STRIPPROG 129 | " 130 | 131 | while test $# -ne 0; do 132 | case $1 in 133 | -c) ;; 134 | 135 | -C) copy_on_change=true;; 136 | 137 | -d) dir_arg=true;; 138 | 139 | -g) chgrpcmd="$chgrpprog $2" 140 | shift;; 141 | 142 | --help) echo "$usage"; exit $?;; 143 | 144 | -m) mode=$2 145 | case $mode in 146 | *' '* | *' '* | *' 147 | '* | *'*'* | *'?'* | *'['*) 148 | echo "$0: invalid mode: $mode" >&2 149 | exit 1;; 150 | esac 151 | shift;; 152 | 153 | -o) chowncmd="$chownprog $2" 154 | shift;; 155 | 156 | -s) stripcmd=$stripprog;; 157 | 158 | -t) dst_arg=$2 159 | shift;; 160 | 161 | -T) no_target_directory=true;; 162 | 163 | --version) echo "$0 $scriptversion"; exit $?;; 164 | 165 | --) shift 166 | break;; 167 | 168 | -*) echo "$0: invalid option: $1" >&2 169 | exit 1;; 170 | 171 | *) break;; 172 | esac 173 | shift 174 | done 175 | 176 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 177 | # When -d is used, all remaining arguments are directories to create. 178 | # When -t is used, the destination is already specified. 179 | # Otherwise, the last argument is the destination. Remove it from $@. 180 | for arg 181 | do 182 | if test -n "$dst_arg"; then 183 | # $@ is not empty: it contains at least $arg. 184 | set fnord "$@" "$dst_arg" 185 | shift # fnord 186 | fi 187 | shift # arg 188 | dst_arg=$arg 189 | done 190 | fi 191 | 192 | if test $# -eq 0; then 193 | if test -z "$dir_arg"; then 194 | echo "$0: no input file specified." >&2 195 | exit 1 196 | fi 197 | # It's OK to call `install-sh -d' without argument. 198 | # This can happen when creating conditional directories. 199 | exit 0 200 | fi 201 | 202 | if test -z "$dir_arg"; then 203 | trap '(exit $?); exit' 1 2 13 15 204 | 205 | # Set umask so as not to create temps with too-generous modes. 206 | # However, 'strip' requires both read and write access to temps. 207 | case $mode in 208 | # Optimize common cases. 209 | *644) cp_umask=133;; 210 | *755) cp_umask=22;; 211 | 212 | *[0-7]) 213 | if test -z "$stripcmd"; then 214 | u_plus_rw= 215 | else 216 | u_plus_rw='% 200' 217 | fi 218 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 219 | *) 220 | if test -z "$stripcmd"; then 221 | u_plus_rw= 222 | else 223 | u_plus_rw=,u+rw 224 | fi 225 | cp_umask=$mode$u_plus_rw;; 226 | esac 227 | fi 228 | 229 | for src 230 | do 231 | # Protect names starting with `-'. 232 | case $src in 233 | -*) src=./$src;; 234 | esac 235 | 236 | if test -n "$dir_arg"; then 237 | dst=$src 238 | dstdir=$dst 239 | test -d "$dstdir" 240 | dstdir_status=$? 241 | else 242 | 243 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 244 | # might cause directories to be created, which would be especially bad 245 | # if $src (and thus $dsttmp) contains '*'. 246 | if test ! -f "$src" && test ! -d "$src"; then 247 | echo "$0: $src does not exist." >&2 248 | exit 1 249 | fi 250 | 251 | if test -z "$dst_arg"; then 252 | echo "$0: no destination specified." >&2 253 | exit 1 254 | fi 255 | 256 | dst=$dst_arg 257 | # Protect names starting with `-'. 258 | case $dst in 259 | -*) dst=./$dst;; 260 | esac 261 | 262 | # If destination is a directory, append the input filename; won't work 263 | # if double slashes aren't ignored. 264 | if test -d "$dst"; then 265 | if test -n "$no_target_directory"; then 266 | echo "$0: $dst_arg: Is a directory" >&2 267 | exit 1 268 | fi 269 | dstdir=$dst 270 | dst=$dstdir/`basename "$src"` 271 | dstdir_status=0 272 | else 273 | # Prefer dirname, but fall back on a substitute if dirname fails. 274 | dstdir=` 275 | (dirname "$dst") 2>/dev/null || 276 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 277 | X"$dst" : 'X\(//\)[^/]' \| \ 278 | X"$dst" : 'X\(//\)$' \| \ 279 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 280 | echo X"$dst" | 281 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 282 | s//\1/ 283 | q 284 | } 285 | /^X\(\/\/\)[^/].*/{ 286 | s//\1/ 287 | q 288 | } 289 | /^X\(\/\/\)$/{ 290 | s//\1/ 291 | q 292 | } 293 | /^X\(\/\).*/{ 294 | s//\1/ 295 | q 296 | } 297 | s/.*/./; q' 298 | ` 299 | 300 | test -d "$dstdir" 301 | dstdir_status=$? 302 | fi 303 | fi 304 | 305 | obsolete_mkdir_used=false 306 | 307 | if test $dstdir_status != 0; then 308 | case $posix_mkdir in 309 | '') 310 | # Create intermediate dirs using mode 755 as modified by the umask. 311 | # This is like FreeBSD 'install' as of 1997-10-28. 312 | umask=`umask` 313 | case $stripcmd.$umask in 314 | # Optimize common cases. 315 | *[2367][2367]) mkdir_umask=$umask;; 316 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 317 | 318 | *[0-7]) 319 | mkdir_umask=`expr $umask + 22 \ 320 | - $umask % 100 % 40 + $umask % 20 \ 321 | - $umask % 10 % 4 + $umask % 2 322 | `;; 323 | *) mkdir_umask=$umask,go-w;; 324 | esac 325 | 326 | # With -d, create the new directory with the user-specified mode. 327 | # Otherwise, rely on $mkdir_umask. 328 | if test -n "$dir_arg"; then 329 | mkdir_mode=-m$mode 330 | else 331 | mkdir_mode= 332 | fi 333 | 334 | posix_mkdir=false 335 | case $umask in 336 | *[123567][0-7][0-7]) 337 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 338 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 339 | ;; 340 | *) 341 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 342 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 343 | 344 | if (umask $mkdir_umask && 345 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 346 | then 347 | if test -z "$dir_arg" || { 348 | # Check for POSIX incompatibilities with -m. 349 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 350 | # other-writeable bit of parent directory when it shouldn't. 351 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 352 | ls_ld_tmpdir=`ls -ld "$tmpdir"` 353 | case $ls_ld_tmpdir in 354 | d????-?r-*) different_mode=700;; 355 | d????-?--*) different_mode=755;; 356 | *) false;; 357 | esac && 358 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { 359 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` 360 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 361 | } 362 | } 363 | then posix_mkdir=: 364 | fi 365 | rmdir "$tmpdir/d" "$tmpdir" 366 | else 367 | # Remove any dirs left behind by ancient mkdir implementations. 368 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null 369 | fi 370 | trap '' 0;; 371 | esac;; 372 | esac 373 | 374 | if 375 | $posix_mkdir && ( 376 | umask $mkdir_umask && 377 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 378 | ) 379 | then : 380 | else 381 | 382 | # The umask is ridiculous, or mkdir does not conform to POSIX, 383 | # or it failed possibly due to a race condition. Create the 384 | # directory the slow way, step by step, checking for races as we go. 385 | 386 | case $dstdir in 387 | /*) prefix='/';; 388 | -*) prefix='./';; 389 | *) prefix='';; 390 | esac 391 | 392 | eval "$initialize_posix_glob" 393 | 394 | oIFS=$IFS 395 | IFS=/ 396 | $posix_glob set -f 397 | set fnord $dstdir 398 | shift 399 | $posix_glob set +f 400 | IFS=$oIFS 401 | 402 | prefixes= 403 | 404 | for d 405 | do 406 | test -z "$d" && continue 407 | 408 | prefix=$prefix$d 409 | if test -d "$prefix"; then 410 | prefixes= 411 | else 412 | if $posix_mkdir; then 413 | (umask=$mkdir_umask && 414 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 415 | # Don't fail if two instances are running concurrently. 416 | test -d "$prefix" || exit 1 417 | else 418 | case $prefix in 419 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 420 | *) qprefix=$prefix;; 421 | esac 422 | prefixes="$prefixes '$qprefix'" 423 | fi 424 | fi 425 | prefix=$prefix/ 426 | done 427 | 428 | if test -n "$prefixes"; then 429 | # Don't fail if two instances are running concurrently. 430 | (umask $mkdir_umask && 431 | eval "\$doit_exec \$mkdirprog $prefixes") || 432 | test -d "$dstdir" || exit 1 433 | obsolete_mkdir_used=true 434 | fi 435 | fi 436 | fi 437 | 438 | if test -n "$dir_arg"; then 439 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 440 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 441 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 442 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 443 | else 444 | 445 | # Make a couple of temp file names in the proper directory. 446 | dsttmp=$dstdir/_inst.$$_ 447 | rmtmp=$dstdir/_rm.$$_ 448 | 449 | # Trap to clean up those temp files at exit. 450 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 451 | 452 | # Copy the file name to the temp name. 453 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 454 | 455 | # and set any options; do chmod last to preserve setuid bits. 456 | # 457 | # If any of these fail, we abort the whole thing. If we want to 458 | # ignore errors from any of these, just make sure not to ignore 459 | # errors from the above "$doit $cpprog $src $dsttmp" command. 460 | # 461 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 462 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 463 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 464 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 465 | 466 | # If -C, don't bother to copy if it wouldn't change the file. 467 | if $copy_on_change && 468 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 469 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 470 | 471 | eval "$initialize_posix_glob" && 472 | $posix_glob set -f && 473 | set X $old && old=:$2:$4:$5:$6 && 474 | set X $new && new=:$2:$4:$5:$6 && 475 | $posix_glob set +f && 476 | 477 | test "$old" = "$new" && 478 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 479 | then 480 | rm -f "$dsttmp" 481 | else 482 | # Rename the file to the real destination. 483 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 484 | 485 | # The rename failed, perhaps because mv can't rename something else 486 | # to itself, or perhaps because mv is so ancient that it does not 487 | # support -f. 488 | { 489 | # Now remove or move aside any old file at destination location. 490 | # We try this two ways since rm can't unlink itself on some 491 | # systems and the destination file might be busy for other 492 | # reasons. In this case, the final cleanup might fail but the new 493 | # file should still install successfully. 494 | { 495 | test ! -f "$dst" || 496 | $doit $rmcmd -f "$dst" 2>/dev/null || 497 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 498 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 499 | } || 500 | { echo "$0: cannot unlink or rename $dst" >&2 501 | (exit 1); exit 1 502 | } 503 | } && 504 | 505 | # Now rename the file to the real destination. 506 | $doit $mvcmd "$dsttmp" "$dst" 507 | } 508 | fi || exit 1 509 | 510 | trap '' 0 511 | fi 512 | done 513 | 514 | # Local variables: 515 | # eval: (add-hook 'write-file-hooks 'time-stamp) 516 | # time-stamp-start: "scriptversion=" 517 | # time-stamp-format: "%:y-%02m-%02d.%02H" 518 | # time-stamp-time-zone: "UTC" 519 | # time-stamp-end: "; # UTC" 520 | # End: 521 | -------------------------------------------------------------------------------- /src/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. 43 | 44 | nl=' 45 | ' 46 | IFS=" "" $nl" 47 | 48 | # set DOITPROG to echo to test this script 49 | 50 | # Don't use :- since 4.3BSD and earlier shells don't like it. 51 | doit=${DOITPROG-} 52 | if test -z "$doit"; then 53 | doit_exec=exec 54 | else 55 | doit_exec=$doit 56 | fi 57 | 58 | # Put in absolute file names if you don't have them in your path; 59 | # or use environment vars. 60 | 61 | chgrpprog=${CHGRPPROG-chgrp} 62 | chmodprog=${CHMODPROG-chmod} 63 | chownprog=${CHOWNPROG-chown} 64 | cmpprog=${CMPPROG-cmp} 65 | cpprog=${CPPROG-cp} 66 | mkdirprog=${MKDIRPROG-mkdir} 67 | mvprog=${MVPROG-mv} 68 | rmprog=${RMPROG-rm} 69 | stripprog=${STRIPPROG-strip} 70 | 71 | posix_glob='?' 72 | initialize_posix_glob=' 73 | test "$posix_glob" != "?" || { 74 | if (set -f) 2>/dev/null; then 75 | posix_glob= 76 | else 77 | posix_glob=: 78 | fi 79 | } 80 | ' 81 | 82 | posix_mkdir= 83 | 84 | # Desired mode of installed file. 85 | mode=0755 86 | 87 | chgrpcmd= 88 | chmodcmd=$chmodprog 89 | chowncmd= 90 | mvcmd=$mvprog 91 | rmcmd="$rmprog -f" 92 | stripcmd= 93 | 94 | src= 95 | dst= 96 | dir_arg= 97 | dst_arg= 98 | 99 | copy_on_change=false 100 | no_target_directory= 101 | 102 | usage="\ 103 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 104 | or: $0 [OPTION]... SRCFILES... DIRECTORY 105 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 106 | or: $0 [OPTION]... -d DIRECTORIES... 107 | 108 | In the 1st form, copy SRCFILE to DSTFILE. 109 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 110 | In the 4th, create DIRECTORIES. 111 | 112 | Options: 113 | --help display this help and exit. 114 | --version display version info and exit. 115 | 116 | -c (ignored) 117 | -C install only if different (preserve the last data modification time) 118 | -d create directories instead of installing files. 119 | -g GROUP $chgrpprog installed files to GROUP. 120 | -m MODE $chmodprog installed files to MODE. 121 | -o USER $chownprog installed files to USER. 122 | -s $stripprog installed files. 123 | -t DIRECTORY install into DIRECTORY. 124 | -T report an error if DSTFILE is a directory. 125 | 126 | Environment variables override the default commands: 127 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG 128 | RMPROG STRIPPROG 129 | " 130 | 131 | while test $# -ne 0; do 132 | case $1 in 133 | -c) ;; 134 | 135 | -C) copy_on_change=true;; 136 | 137 | -d) dir_arg=true;; 138 | 139 | -g) chgrpcmd="$chgrpprog $2" 140 | shift;; 141 | 142 | --help) echo "$usage"; exit $?;; 143 | 144 | -m) mode=$2 145 | case $mode in 146 | *' '* | *' '* | *' 147 | '* | *'*'* | *'?'* | *'['*) 148 | echo "$0: invalid mode: $mode" >&2 149 | exit 1;; 150 | esac 151 | shift;; 152 | 153 | -o) chowncmd="$chownprog $2" 154 | shift;; 155 | 156 | -s) stripcmd=$stripprog;; 157 | 158 | -t) dst_arg=$2 159 | shift;; 160 | 161 | -T) no_target_directory=true;; 162 | 163 | --version) echo "$0 $scriptversion"; exit $?;; 164 | 165 | --) shift 166 | break;; 167 | 168 | -*) echo "$0: invalid option: $1" >&2 169 | exit 1;; 170 | 171 | *) break;; 172 | esac 173 | shift 174 | done 175 | 176 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then 177 | # When -d is used, all remaining arguments are directories to create. 178 | # When -t is used, the destination is already specified. 179 | # Otherwise, the last argument is the destination. Remove it from $@. 180 | for arg 181 | do 182 | if test -n "$dst_arg"; then 183 | # $@ is not empty: it contains at least $arg. 184 | set fnord "$@" "$dst_arg" 185 | shift # fnord 186 | fi 187 | shift # arg 188 | dst_arg=$arg 189 | done 190 | fi 191 | 192 | if test $# -eq 0; then 193 | if test -z "$dir_arg"; then 194 | echo "$0: no input file specified." >&2 195 | exit 1 196 | fi 197 | # It's OK to call `install-sh -d' without argument. 198 | # This can happen when creating conditional directories. 199 | exit 0 200 | fi 201 | 202 | if test -z "$dir_arg"; then 203 | trap '(exit $?); exit' 1 2 13 15 204 | 205 | # Set umask so as not to create temps with too-generous modes. 206 | # However, 'strip' requires both read and write access to temps. 207 | case $mode in 208 | # Optimize common cases. 209 | *644) cp_umask=133;; 210 | *755) cp_umask=22;; 211 | 212 | *[0-7]) 213 | if test -z "$stripcmd"; then 214 | u_plus_rw= 215 | else 216 | u_plus_rw='% 200' 217 | fi 218 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; 219 | *) 220 | if test -z "$stripcmd"; then 221 | u_plus_rw= 222 | else 223 | u_plus_rw=,u+rw 224 | fi 225 | cp_umask=$mode$u_plus_rw;; 226 | esac 227 | fi 228 | 229 | for src 230 | do 231 | # Protect names starting with `-'. 232 | case $src in 233 | -*) src=./$src;; 234 | esac 235 | 236 | if test -n "$dir_arg"; then 237 | dst=$src 238 | dstdir=$dst 239 | test -d "$dstdir" 240 | dstdir_status=$? 241 | else 242 | 243 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 244 | # might cause directories to be created, which would be especially bad 245 | # if $src (and thus $dsttmp) contains '*'. 246 | if test ! -f "$src" && test ! -d "$src"; then 247 | echo "$0: $src does not exist." >&2 248 | exit 1 249 | fi 250 | 251 | if test -z "$dst_arg"; then 252 | echo "$0: no destination specified." >&2 253 | exit 1 254 | fi 255 | 256 | dst=$dst_arg 257 | # Protect names starting with `-'. 258 | case $dst in 259 | -*) dst=./$dst;; 260 | esac 261 | 262 | # If destination is a directory, append the input filename; won't work 263 | # if double slashes aren't ignored. 264 | if test -d "$dst"; then 265 | if test -n "$no_target_directory"; then 266 | echo "$0: $dst_arg: Is a directory" >&2 267 | exit 1 268 | fi 269 | dstdir=$dst 270 | dst=$dstdir/`basename "$src"` 271 | dstdir_status=0 272 | else 273 | # Prefer dirname, but fall back on a substitute if dirname fails. 274 | dstdir=` 275 | (dirname "$dst") 2>/dev/null || 276 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 277 | X"$dst" : 'X\(//\)[^/]' \| \ 278 | X"$dst" : 'X\(//\)$' \| \ 279 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || 280 | echo X"$dst" | 281 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 282 | s//\1/ 283 | q 284 | } 285 | /^X\(\/\/\)[^/].*/{ 286 | s//\1/ 287 | q 288 | } 289 | /^X\(\/\/\)$/{ 290 | s//\1/ 291 | q 292 | } 293 | /^X\(\/\).*/{ 294 | s//\1/ 295 | q 296 | } 297 | s/.*/./; q' 298 | ` 299 | 300 | test -d "$dstdir" 301 | dstdir_status=$? 302 | fi 303 | fi 304 | 305 | obsolete_mkdir_used=false 306 | 307 | if test $dstdir_status != 0; then 308 | case $posix_mkdir in 309 | '') 310 | # Create intermediate dirs using mode 755 as modified by the umask. 311 | # This is like FreeBSD 'install' as of 1997-10-28. 312 | umask=`umask` 313 | case $stripcmd.$umask in 314 | # Optimize common cases. 315 | *[2367][2367]) mkdir_umask=$umask;; 316 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; 317 | 318 | *[0-7]) 319 | mkdir_umask=`expr $umask + 22 \ 320 | - $umask % 100 % 40 + $umask % 20 \ 321 | - $umask % 10 % 4 + $umask % 2 322 | `;; 323 | *) mkdir_umask=$umask,go-w;; 324 | esac 325 | 326 | # With -d, create the new directory with the user-specified mode. 327 | # Otherwise, rely on $mkdir_umask. 328 | if test -n "$dir_arg"; then 329 | mkdir_mode=-m$mode 330 | else 331 | mkdir_mode= 332 | fi 333 | 334 | posix_mkdir=false 335 | case $umask in 336 | *[123567][0-7][0-7]) 337 | # POSIX mkdir -p sets u+wx bits regardless of umask, which 338 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. 339 | ;; 340 | *) 341 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ 342 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 343 | 344 | if (umask $mkdir_umask && 345 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 346 | then 347 | if test -z "$dir_arg" || { 348 | # Check for POSIX incompatibilities with -m. 349 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or 350 | # other-writeable bit of parent directory when it shouldn't. 351 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. 352 | ls_ld_tmpdir=`ls -ld "$tmpdir"` 353 | case $ls_ld_tmpdir in 354 | d????-?r-*) different_mode=700;; 355 | d????-?--*) different_mode=755;; 356 | *) false;; 357 | esac && 358 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { 359 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` 360 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" 361 | } 362 | } 363 | then posix_mkdir=: 364 | fi 365 | rmdir "$tmpdir/d" "$tmpdir" 366 | else 367 | # Remove any dirs left behind by ancient mkdir implementations. 368 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null 369 | fi 370 | trap '' 0;; 371 | esac;; 372 | esac 373 | 374 | if 375 | $posix_mkdir && ( 376 | umask $mkdir_umask && 377 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" 378 | ) 379 | then : 380 | else 381 | 382 | # The umask is ridiculous, or mkdir does not conform to POSIX, 383 | # or it failed possibly due to a race condition. Create the 384 | # directory the slow way, step by step, checking for races as we go. 385 | 386 | case $dstdir in 387 | /*) prefix='/';; 388 | -*) prefix='./';; 389 | *) prefix='';; 390 | esac 391 | 392 | eval "$initialize_posix_glob" 393 | 394 | oIFS=$IFS 395 | IFS=/ 396 | $posix_glob set -f 397 | set fnord $dstdir 398 | shift 399 | $posix_glob set +f 400 | IFS=$oIFS 401 | 402 | prefixes= 403 | 404 | for d 405 | do 406 | test -z "$d" && continue 407 | 408 | prefix=$prefix$d 409 | if test -d "$prefix"; then 410 | prefixes= 411 | else 412 | if $posix_mkdir; then 413 | (umask=$mkdir_umask && 414 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break 415 | # Don't fail if two instances are running concurrently. 416 | test -d "$prefix" || exit 1 417 | else 418 | case $prefix in 419 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; 420 | *) qprefix=$prefix;; 421 | esac 422 | prefixes="$prefixes '$qprefix'" 423 | fi 424 | fi 425 | prefix=$prefix/ 426 | done 427 | 428 | if test -n "$prefixes"; then 429 | # Don't fail if two instances are running concurrently. 430 | (umask $mkdir_umask && 431 | eval "\$doit_exec \$mkdirprog $prefixes") || 432 | test -d "$dstdir" || exit 1 433 | obsolete_mkdir_used=true 434 | fi 435 | fi 436 | fi 437 | 438 | if test -n "$dir_arg"; then 439 | { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && 440 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && 441 | { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || 442 | test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 443 | else 444 | 445 | # Make a couple of temp file names in the proper directory. 446 | dsttmp=$dstdir/_inst.$$_ 447 | rmtmp=$dstdir/_rm.$$_ 448 | 449 | # Trap to clean up those temp files at exit. 450 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 451 | 452 | # Copy the file name to the temp name. 453 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && 454 | 455 | # and set any options; do chmod last to preserve setuid bits. 456 | # 457 | # If any of these fail, we abort the whole thing. If we want to 458 | # ignore errors from any of these, just make sure not to ignore 459 | # errors from the above "$doit $cpprog $src $dsttmp" command. 460 | # 461 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && 462 | { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && 463 | { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && 464 | { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && 465 | 466 | # If -C, don't bother to copy if it wouldn't change the file. 467 | if $copy_on_change && 468 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && 469 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 470 | 471 | eval "$initialize_posix_glob" && 472 | $posix_glob set -f && 473 | set X $old && old=:$2:$4:$5:$6 && 474 | set X $new && new=:$2:$4:$5:$6 && 475 | $posix_glob set +f && 476 | 477 | test "$old" = "$new" && 478 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 479 | then 480 | rm -f "$dsttmp" 481 | else 482 | # Rename the file to the real destination. 483 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || 484 | 485 | # The rename failed, perhaps because mv can't rename something else 486 | # to itself, or perhaps because mv is so ancient that it does not 487 | # support -f. 488 | { 489 | # Now remove or move aside any old file at destination location. 490 | # We try this two ways since rm can't unlink itself on some 491 | # systems and the destination file might be busy for other 492 | # reasons. In this case, the final cleanup might fail but the new 493 | # file should still install successfully. 494 | { 495 | test ! -f "$dst" || 496 | $doit $rmcmd -f "$dst" 2>/dev/null || 497 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && 498 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } 499 | } || 500 | { echo "$0: cannot unlink or rename $dst" >&2 501 | (exit 1); exit 1 502 | } 503 | } && 504 | 505 | # Now rename the file to the real destination. 506 | $doit $mvcmd "$dsttmp" "$dst" 507 | } 508 | fi || exit 1 509 | 510 | trap '' 0 511 | fi 512 | done 513 | 514 | # Local variables: 515 | # eval: (add-hook 'write-file-hooks 'time-stamp) 516 | # time-stamp-start: "scriptversion=" 517 | # time-stamp-format: "%:y-%02m-%02d.%02H" 518 | # time-stamp-time-zone: "UTC" 519 | # time-stamp-end: "; # UTC" 520 | # End: 521 | -------------------------------------------------------------------------------- /src/depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2009-04-28.21; # UTC 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free 7 | # Software Foundation, Inc. 8 | 9 | # This program is free software; you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation; either version 2, or (at your option) 12 | # any later version. 13 | 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # Originally written by Alexandre Oliva . 28 | 29 | case $1 in 30 | '') 31 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 32 | exit 1; 33 | ;; 34 | -h | --h*) 35 | cat <<\EOF 36 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 37 | 38 | Run PROGRAMS ARGS to compile a file, generating dependencies 39 | as side-effects. 40 | 41 | Environment variables: 42 | depmode Dependency tracking mode. 43 | source Source file read by `PROGRAMS ARGS'. 44 | object Object file output by `PROGRAMS ARGS'. 45 | DEPDIR directory where to store dependencies. 46 | depfile Dependency file to output. 47 | tmpdepfile Temporary file to use when outputing dependencies. 48 | libtool Whether libtool is used (yes/no). 49 | 50 | Report bugs to . 51 | EOF 52 | exit $? 53 | ;; 54 | -v | --v*) 55 | echo "depcomp $scriptversion" 56 | exit $? 57 | ;; 58 | esac 59 | 60 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 61 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 62 | exit 1 63 | fi 64 | 65 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 66 | depfile=${depfile-`echo "$object" | 67 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 68 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 69 | 70 | rm -f "$tmpdepfile" 71 | 72 | # Some modes work just like other modes, but use different flags. We 73 | # parameterize here, but still list the modes in the big case below, 74 | # to make depend.m4 easier to write. Note that we *cannot* use a case 75 | # here, because this file can only contain one case statement. 76 | if test "$depmode" = hp; then 77 | # HP compiler uses -M and no extra arg. 78 | gccflag=-M 79 | depmode=gcc 80 | fi 81 | 82 | if test "$depmode" = dashXmstdout; then 83 | # This is just like dashmstdout with a different argument. 84 | dashmflag=-xM 85 | depmode=dashmstdout 86 | fi 87 | 88 | cygpath_u="cygpath -u -f -" 89 | if test "$depmode" = msvcmsys; then 90 | # This is just like msvisualcpp but w/o cygpath translation. 91 | # Just convert the backslash-escaped backslashes to single forward 92 | # slashes to satisfy depend.m4 93 | cygpath_u="sed s,\\\\\\\\,/,g" 94 | depmode=msvisualcpp 95 | fi 96 | 97 | case "$depmode" in 98 | gcc3) 99 | ## gcc 3 implements dependency tracking that does exactly what 100 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 101 | ## it if -MD -MP comes after the -MF stuff. Hmm. 102 | ## Unfortunately, FreeBSD c89 acceptance of flags depends upon 103 | ## the command line argument order; so add the flags where they 104 | ## appear in depend2.am. Note that the slowdown incurred here 105 | ## affects only configure: in makefiles, %FASTDEP% shortcuts this. 106 | for arg 107 | do 108 | case $arg in 109 | -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; 110 | *) set fnord "$@" "$arg" ;; 111 | esac 112 | shift # fnord 113 | shift # $arg 114 | done 115 | "$@" 116 | stat=$? 117 | if test $stat -eq 0; then : 118 | else 119 | rm -f "$tmpdepfile" 120 | exit $stat 121 | fi 122 | mv "$tmpdepfile" "$depfile" 123 | ;; 124 | 125 | gcc) 126 | ## There are various ways to get dependency output from gcc. Here's 127 | ## why we pick this rather obscure method: 128 | ## - Don't want to use -MD because we'd like the dependencies to end 129 | ## up in a subdir. Having to rename by hand is ugly. 130 | ## (We might end up doing this anyway to support other compilers.) 131 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 132 | ## -MM, not -M (despite what the docs say). 133 | ## - Using -M directly means running the compiler twice (even worse 134 | ## than renaming). 135 | if test -z "$gccflag"; then 136 | gccflag=-MD, 137 | fi 138 | "$@" -Wp,"$gccflag$tmpdepfile" 139 | stat=$? 140 | if test $stat -eq 0; then : 141 | else 142 | rm -f "$tmpdepfile" 143 | exit $stat 144 | fi 145 | rm -f "$depfile" 146 | echo "$object : \\" > "$depfile" 147 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 148 | ## The second -e expression handles DOS-style file names with drive letters. 149 | sed -e 's/^[^:]*: / /' \ 150 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 151 | ## This next piece of magic avoids the `deleted header file' problem. 152 | ## The problem is that when a header file which appears in a .P file 153 | ## is deleted, the dependency causes make to die (because there is 154 | ## typically no way to rebuild the header). We avoid this by adding 155 | ## dummy dependencies for each header file. Too bad gcc doesn't do 156 | ## this for us directly. 157 | tr ' ' ' 158 | ' < "$tmpdepfile" | 159 | ## Some versions of gcc put a space before the `:'. On the theory 160 | ## that the space means something, we add a space to the output as 161 | ## well. 162 | ## Some versions of the HPUX 10.20 sed can't process this invocation 163 | ## correctly. Breaking it into two sed invocations is a workaround. 164 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 165 | rm -f "$tmpdepfile" 166 | ;; 167 | 168 | hp) 169 | # This case exists only to let depend.m4 do its work. It works by 170 | # looking at the text of this script. This case will never be run, 171 | # since it is checked for above. 172 | exit 1 173 | ;; 174 | 175 | sgi) 176 | if test "$libtool" = yes; then 177 | "$@" "-Wp,-MDupdate,$tmpdepfile" 178 | else 179 | "$@" -MDupdate "$tmpdepfile" 180 | fi 181 | stat=$? 182 | if test $stat -eq 0; then : 183 | else 184 | rm -f "$tmpdepfile" 185 | exit $stat 186 | fi 187 | rm -f "$depfile" 188 | 189 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 190 | echo "$object : \\" > "$depfile" 191 | 192 | # Clip off the initial element (the dependent). Don't try to be 193 | # clever and replace this with sed code, as IRIX sed won't handle 194 | # lines with more than a fixed number of characters (4096 in 195 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 196 | # the IRIX cc adds comments like `#:fec' to the end of the 197 | # dependency line. 198 | tr ' ' ' 199 | ' < "$tmpdepfile" \ 200 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 201 | tr ' 202 | ' ' ' >> "$depfile" 203 | echo >> "$depfile" 204 | 205 | # The second pass generates a dummy entry for each header file. 206 | tr ' ' ' 207 | ' < "$tmpdepfile" \ 208 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 209 | >> "$depfile" 210 | else 211 | # The sourcefile does not contain any dependencies, so just 212 | # store a dummy comment line, to avoid errors with the Makefile 213 | # "include basename.Plo" scheme. 214 | echo "#dummy" > "$depfile" 215 | fi 216 | rm -f "$tmpdepfile" 217 | ;; 218 | 219 | aix) 220 | # The C for AIX Compiler uses -M and outputs the dependencies 221 | # in a .u file. In older versions, this file always lives in the 222 | # current directory. Also, the AIX compiler puts `$object:' at the 223 | # start of each line; $object doesn't have directory information. 224 | # Version 6 uses the directory in both cases. 225 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 226 | test "x$dir" = "x$object" && dir= 227 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 228 | if test "$libtool" = yes; then 229 | tmpdepfile1=$dir$base.u 230 | tmpdepfile2=$base.u 231 | tmpdepfile3=$dir.libs/$base.u 232 | "$@" -Wc,-M 233 | else 234 | tmpdepfile1=$dir$base.u 235 | tmpdepfile2=$dir$base.u 236 | tmpdepfile3=$dir$base.u 237 | "$@" -M 238 | fi 239 | stat=$? 240 | 241 | if test $stat -eq 0; then : 242 | else 243 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 244 | exit $stat 245 | fi 246 | 247 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 248 | do 249 | test -f "$tmpdepfile" && break 250 | done 251 | if test -f "$tmpdepfile"; then 252 | # Each line is of the form `foo.o: dependent.h'. 253 | # Do two passes, one to just change these to 254 | # `$object: dependent.h' and one to simply `dependent.h:'. 255 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 256 | # That's a tab and a space in the []. 257 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 258 | else 259 | # The sourcefile does not contain any dependencies, so just 260 | # store a dummy comment line, to avoid errors with the Makefile 261 | # "include basename.Plo" scheme. 262 | echo "#dummy" > "$depfile" 263 | fi 264 | rm -f "$tmpdepfile" 265 | ;; 266 | 267 | icc) 268 | # Intel's C compiler understands `-MD -MF file'. However on 269 | # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c 270 | # ICC 7.0 will fill foo.d with something like 271 | # foo.o: sub/foo.c 272 | # foo.o: sub/foo.h 273 | # which is wrong. We want: 274 | # sub/foo.o: sub/foo.c 275 | # sub/foo.o: sub/foo.h 276 | # sub/foo.c: 277 | # sub/foo.h: 278 | # ICC 7.1 will output 279 | # foo.o: sub/foo.c sub/foo.h 280 | # and will wrap long lines using \ : 281 | # foo.o: sub/foo.c ... \ 282 | # sub/foo.h ... \ 283 | # ... 284 | 285 | "$@" -MD -MF "$tmpdepfile" 286 | stat=$? 287 | if test $stat -eq 0; then : 288 | else 289 | rm -f "$tmpdepfile" 290 | exit $stat 291 | fi 292 | rm -f "$depfile" 293 | # Each line is of the form `foo.o: dependent.h', 294 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 295 | # Do two passes, one to just change these to 296 | # `$object: dependent.h' and one to simply `dependent.h:'. 297 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 298 | # Some versions of the HPUX 10.20 sed can't process this invocation 299 | # correctly. Breaking it into two sed invocations is a workaround. 300 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | 301 | sed -e 's/$/ :/' >> "$depfile" 302 | rm -f "$tmpdepfile" 303 | ;; 304 | 305 | hp2) 306 | # The "hp" stanza above does not work with aCC (C++) and HP's ia64 307 | # compilers, which have integrated preprocessors. The correct option 308 | # to use with these is +Maked; it writes dependencies to a file named 309 | # 'foo.d', which lands next to the object file, wherever that 310 | # happens to be. 311 | # Much of this is similar to the tru64 case; see comments there. 312 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 313 | test "x$dir" = "x$object" && dir= 314 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 315 | if test "$libtool" = yes; then 316 | tmpdepfile1=$dir$base.d 317 | tmpdepfile2=$dir.libs/$base.d 318 | "$@" -Wc,+Maked 319 | else 320 | tmpdepfile1=$dir$base.d 321 | tmpdepfile2=$dir$base.d 322 | "$@" +Maked 323 | fi 324 | stat=$? 325 | if test $stat -eq 0; then : 326 | else 327 | rm -f "$tmpdepfile1" "$tmpdepfile2" 328 | exit $stat 329 | fi 330 | 331 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" 332 | do 333 | test -f "$tmpdepfile" && break 334 | done 335 | if test -f "$tmpdepfile"; then 336 | sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" 337 | # Add `dependent.h:' lines. 338 | sed -ne '2,${ 339 | s/^ *// 340 | s/ \\*$// 341 | s/$/:/ 342 | p 343 | }' "$tmpdepfile" >> "$depfile" 344 | else 345 | echo "#dummy" > "$depfile" 346 | fi 347 | rm -f "$tmpdepfile" "$tmpdepfile2" 348 | ;; 349 | 350 | tru64) 351 | # The Tru64 compiler uses -MD to generate dependencies as a side 352 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 353 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 354 | # dependencies in `foo.d' instead, so we check for that too. 355 | # Subdirectories are respected. 356 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 357 | test "x$dir" = "x$object" && dir= 358 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 359 | 360 | if test "$libtool" = yes; then 361 | # With Tru64 cc, shared objects can also be used to make a 362 | # static library. This mechanism is used in libtool 1.4 series to 363 | # handle both shared and static libraries in a single compilation. 364 | # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. 365 | # 366 | # With libtool 1.5 this exception was removed, and libtool now 367 | # generates 2 separate objects for the 2 libraries. These two 368 | # compilations output dependencies in $dir.libs/$base.o.d and 369 | # in $dir$base.o.d. We have to check for both files, because 370 | # one of the two compilations can be disabled. We should prefer 371 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 372 | # automatically cleaned when .libs/ is deleted, while ignoring 373 | # the former would cause a distcleancheck panic. 374 | tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 375 | tmpdepfile2=$dir$base.o.d # libtool 1.5 376 | tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 377 | tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 378 | "$@" -Wc,-MD 379 | else 380 | tmpdepfile1=$dir$base.o.d 381 | tmpdepfile2=$dir$base.d 382 | tmpdepfile3=$dir$base.d 383 | tmpdepfile4=$dir$base.d 384 | "$@" -MD 385 | fi 386 | 387 | stat=$? 388 | if test $stat -eq 0; then : 389 | else 390 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 391 | exit $stat 392 | fi 393 | 394 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 395 | do 396 | test -f "$tmpdepfile" && break 397 | done 398 | if test -f "$tmpdepfile"; then 399 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 400 | # That's a tab and a space in the []. 401 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 402 | else 403 | echo "#dummy" > "$depfile" 404 | fi 405 | rm -f "$tmpdepfile" 406 | ;; 407 | 408 | #nosideeffect) 409 | # This comment above is used by automake to tell side-effect 410 | # dependency tracking mechanisms from slower ones. 411 | 412 | dashmstdout) 413 | # Important note: in order to support this mode, a compiler *must* 414 | # always write the preprocessed file to stdout, regardless of -o. 415 | "$@" || exit $? 416 | 417 | # Remove the call to Libtool. 418 | if test "$libtool" = yes; then 419 | while test "X$1" != 'X--mode=compile'; do 420 | shift 421 | done 422 | shift 423 | fi 424 | 425 | # Remove `-o $object'. 426 | IFS=" " 427 | for arg 428 | do 429 | case $arg in 430 | -o) 431 | shift 432 | ;; 433 | $object) 434 | shift 435 | ;; 436 | *) 437 | set fnord "$@" "$arg" 438 | shift # fnord 439 | shift # $arg 440 | ;; 441 | esac 442 | done 443 | 444 | test -z "$dashmflag" && dashmflag=-M 445 | # Require at least two characters before searching for `:' 446 | # in the target name. This is to cope with DOS-style filenames: 447 | # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. 448 | "$@" $dashmflag | 449 | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 450 | rm -f "$depfile" 451 | cat < "$tmpdepfile" > "$depfile" 452 | tr ' ' ' 453 | ' < "$tmpdepfile" | \ 454 | ## Some versions of the HPUX 10.20 sed can't process this invocation 455 | ## correctly. Breaking it into two sed invocations is a workaround. 456 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 457 | rm -f "$tmpdepfile" 458 | ;; 459 | 460 | dashXmstdout) 461 | # This case only exists to satisfy depend.m4. It is never actually 462 | # run, as this mode is specially recognized in the preamble. 463 | exit 1 464 | ;; 465 | 466 | makedepend) 467 | "$@" || exit $? 468 | # Remove any Libtool call 469 | if test "$libtool" = yes; then 470 | while test "X$1" != 'X--mode=compile'; do 471 | shift 472 | done 473 | shift 474 | fi 475 | # X makedepend 476 | shift 477 | cleared=no eat=no 478 | for arg 479 | do 480 | case $cleared in 481 | no) 482 | set ""; shift 483 | cleared=yes ;; 484 | esac 485 | if test $eat = yes; then 486 | eat=no 487 | continue 488 | fi 489 | case "$arg" in 490 | -D*|-I*) 491 | set fnord "$@" "$arg"; shift ;; 492 | # Strip any option that makedepend may not understand. Remove 493 | # the object too, otherwise makedepend will parse it as a source file. 494 | -arch) 495 | eat=yes ;; 496 | -*|$object) 497 | ;; 498 | *) 499 | set fnord "$@" "$arg"; shift ;; 500 | esac 501 | done 502 | obj_suffix=`echo "$object" | sed 's/^.*\././'` 503 | touch "$tmpdepfile" 504 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 505 | rm -f "$depfile" 506 | cat < "$tmpdepfile" > "$depfile" 507 | sed '1,2d' "$tmpdepfile" | tr ' ' ' 508 | ' | \ 509 | ## Some versions of the HPUX 10.20 sed can't process this invocation 510 | ## correctly. Breaking it into two sed invocations is a workaround. 511 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 512 | rm -f "$tmpdepfile" "$tmpdepfile".bak 513 | ;; 514 | 515 | cpp) 516 | # Important note: in order to support this mode, a compiler *must* 517 | # always write the preprocessed file to stdout. 518 | "$@" || exit $? 519 | 520 | # Remove the call to Libtool. 521 | if test "$libtool" = yes; then 522 | while test "X$1" != 'X--mode=compile'; do 523 | shift 524 | done 525 | shift 526 | fi 527 | 528 | # Remove `-o $object'. 529 | IFS=" " 530 | for arg 531 | do 532 | case $arg in 533 | -o) 534 | shift 535 | ;; 536 | $object) 537 | shift 538 | ;; 539 | *) 540 | set fnord "$@" "$arg" 541 | shift # fnord 542 | shift # $arg 543 | ;; 544 | esac 545 | done 546 | 547 | "$@" -E | 548 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 549 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 550 | sed '$ s: \\$::' > "$tmpdepfile" 551 | rm -f "$depfile" 552 | echo "$object : \\" > "$depfile" 553 | cat < "$tmpdepfile" >> "$depfile" 554 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 555 | rm -f "$tmpdepfile" 556 | ;; 557 | 558 | msvisualcpp) 559 | # Important note: in order to support this mode, a compiler *must* 560 | # always write the preprocessed file to stdout. 561 | "$@" || exit $? 562 | 563 | # Remove the call to Libtool. 564 | if test "$libtool" = yes; then 565 | while test "X$1" != 'X--mode=compile'; do 566 | shift 567 | done 568 | shift 569 | fi 570 | 571 | IFS=" " 572 | for arg 573 | do 574 | case "$arg" in 575 | -o) 576 | shift 577 | ;; 578 | $object) 579 | shift 580 | ;; 581 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 582 | set fnord "$@" 583 | shift 584 | shift 585 | ;; 586 | *) 587 | set fnord "$@" "$arg" 588 | shift 589 | shift 590 | ;; 591 | esac 592 | done 593 | "$@" -E 2>/dev/null | 594 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" 595 | rm -f "$depfile" 596 | echo "$object : \\" > "$depfile" 597 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 598 | echo " " >> "$depfile" 599 | sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" 600 | rm -f "$tmpdepfile" 601 | ;; 602 | 603 | msvcmsys) 604 | # This case exists only to let depend.m4 do its work. It works by 605 | # looking at the text of this script. This case will never be run, 606 | # since it is checked for above. 607 | exit 1 608 | ;; 609 | 610 | none) 611 | exec "$@" 612 | ;; 613 | 614 | *) 615 | echo "Unknown depmode $depmode" 1>&2 616 | exit 1 617 | ;; 618 | esac 619 | 620 | exit 0 621 | 622 | # Local Variables: 623 | # mode: shell-script 624 | # sh-indentation: 2 625 | # eval: (add-hook 'write-file-hooks 'time-stamp) 626 | # time-stamp-start: "scriptversion=" 627 | # time-stamp-format: "%:y-%02m-%02d.%02H" 628 | # time-stamp-time-zone: "UTC" 629 | # time-stamp-end: "; # UTC" 630 | # End: 631 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.11.1 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 | # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_ifndef([AC_AUTOCONF_VERSION], 15 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 17 | [m4_warning([this file was generated for autoconf 2.68. 18 | You have another version of autoconf. It may work, but is not guaranteed to. 19 | If you have problems, you may need to regenerate the build system entirely. 20 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) 21 | 22 | # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 23 | # 24 | # This file is free software; the Free Software Foundation 25 | # gives unlimited permission to copy and/or distribute it, 26 | # with or without modifications, as long as this notice is preserved. 27 | 28 | # AM_AUTOMAKE_VERSION(VERSION) 29 | # ---------------------------- 30 | # Automake X.Y traces this macro to ensure aclocal.m4 has been 31 | # generated from the m4 files accompanying Automake X.Y. 32 | # (This private macro should not be called outside this file.) 33 | AC_DEFUN([AM_AUTOMAKE_VERSION], 34 | [am__api_version='1.11' 35 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 36 | dnl require some minimum version. Point them to the right macro. 37 | m4_if([$1], [1.11.1], [], 38 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 39 | ]) 40 | 41 | # _AM_AUTOCONF_VERSION(VERSION) 42 | # ----------------------------- 43 | # aclocal traces this macro to find the Autoconf version. 44 | # This is a private macro too. Using m4_define simplifies 45 | # the logic in aclocal, which can simply ignore this definition. 46 | m4_define([_AM_AUTOCONF_VERSION], []) 47 | 48 | # AM_SET_CURRENT_AUTOMAKE_VERSION 49 | # ------------------------------- 50 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 51 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 53 | [AM_AUTOMAKE_VERSION([1.11.1])dnl 54 | m4_ifndef([AC_AUTOCONF_VERSION], 55 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 56 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 57 | 58 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- 59 | 60 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 61 | # 62 | # This file is free software; the Free Software Foundation 63 | # gives unlimited permission to copy and/or distribute it, 64 | # with or without modifications, as long as this notice is preserved. 65 | 66 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67 | # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 68 | # `$srcdir', `$srcdir/..', or `$srcdir/../..'. 69 | # 70 | # Of course, Automake must honor this variable whenever it calls a 71 | # tool from the auxiliary directory. The problem is that $srcdir (and 72 | # therefore $ac_aux_dir as well) can be either absolute or relative, 73 | # depending on how configure is run. This is pretty annoying, since 74 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top 75 | # source directory, any form will work fine, but in subdirectories a 76 | # relative path needs to be adjusted first. 77 | # 78 | # $ac_aux_dir/missing 79 | # fails when called from a subdirectory if $ac_aux_dir is relative 80 | # $top_srcdir/$ac_aux_dir/missing 81 | # fails if $ac_aux_dir is absolute, 82 | # fails when called from a subdirectory in a VPATH build with 83 | # a relative $ac_aux_dir 84 | # 85 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86 | # are both prefixed by $srcdir. In an in-source build this is usually 87 | # harmless because $srcdir is `.', but things will broke when you 88 | # start a VPATH build or use an absolute $srcdir. 89 | # 90 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 91 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: 92 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 93 | # and then we would define $MISSING as 94 | # MISSING="\${SHELL} $am_aux_dir/missing" 95 | # This will work as long as MISSING is not called from configure, because 96 | # unfortunately $(top_srcdir) has no meaning in configure. 97 | # However there are other variables, like CC, which are often used in 98 | # configure, and could therefore not use this "fixed" $ac_aux_dir. 99 | # 100 | # Another solution, used here, is to always expand $ac_aux_dir to an 101 | # absolute PATH. The drawback is that using absolute paths prevent a 102 | # configured tree to be moved without reconfiguration. 103 | 104 | AC_DEFUN([AM_AUX_DIR_EXPAND], 105 | [dnl Rely on autoconf to set up CDPATH properly. 106 | AC_PREREQ([2.50])dnl 107 | # expand $ac_aux_dir to an absolute path 108 | am_aux_dir=`cd $ac_aux_dir && pwd` 109 | ]) 110 | 111 | # Do all the work for Automake. -*- Autoconf -*- 112 | 113 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 114 | # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 115 | # 116 | # This file is free software; the Free Software Foundation 117 | # gives unlimited permission to copy and/or distribute it, 118 | # with or without modifications, as long as this notice is preserved. 119 | 120 | # serial 16 121 | 122 | # This macro actually does too much. Some checks are only needed if 123 | # your package does certain things. But this isn't really a big deal. 124 | 125 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 126 | # AM_INIT_AUTOMAKE([OPTIONS]) 127 | # ----------------------------------------------- 128 | # The call with PACKAGE and VERSION arguments is the old style 129 | # call (pre autoconf-2.50), which is being phased out. PACKAGE 130 | # and VERSION should now be passed to AC_INIT and removed from 131 | # the call to AM_INIT_AUTOMAKE. 132 | # We support both call styles for the transition. After 133 | # the next Automake release, Autoconf can make the AC_INIT 134 | # arguments mandatory, and then we can depend on a new Autoconf 135 | # release and drop the old call support. 136 | AC_DEFUN([AM_INIT_AUTOMAKE], 137 | [AC_PREREQ([2.62])dnl 138 | dnl Autoconf wants to disallow AM_ names. We explicitly allow 139 | dnl the ones we care about. 140 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 141 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 142 | AC_REQUIRE([AC_PROG_INSTALL])dnl 143 | if test "`cd $srcdir && pwd`" != "`pwd`"; then 144 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 145 | # is not polluted with repeated "-I." 146 | AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 147 | # test to see if srcdir already configured 148 | if test -f $srcdir/config.status; then 149 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 150 | fi 151 | fi 152 | 153 | # test whether we have cygpath 154 | if test -z "$CYGPATH_W"; then 155 | if (cygpath --version) >/dev/null 2>/dev/null; then 156 | CYGPATH_W='cygpath -w' 157 | else 158 | CYGPATH_W=echo 159 | fi 160 | fi 161 | AC_SUBST([CYGPATH_W]) 162 | 163 | # Define the identity of the package. 164 | dnl Distinguish between old-style and new-style calls. 165 | m4_ifval([$2], 166 | [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 167 | AC_SUBST([PACKAGE], [$1])dnl 168 | AC_SUBST([VERSION], [$2])], 169 | [_AM_SET_OPTIONS([$1])dnl 170 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 171 | m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 172 | [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 173 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 174 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 175 | 176 | _AM_IF_OPTION([no-define],, 177 | [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 178 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 179 | 180 | # Some tools Automake needs. 181 | AC_REQUIRE([AM_SANITY_CHECK])dnl 182 | AC_REQUIRE([AC_ARG_PROGRAM])dnl 183 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 184 | AM_MISSING_PROG(AUTOCONF, autoconf) 185 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 186 | AM_MISSING_PROG(AUTOHEADER, autoheader) 187 | AM_MISSING_PROG(MAKEINFO, makeinfo) 188 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 189 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 190 | AC_REQUIRE([AM_PROG_MKDIR_P])dnl 191 | # We need awk for the "check" target. The system "awk" is bad on 192 | # some platforms. 193 | AC_REQUIRE([AC_PROG_AWK])dnl 194 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl 195 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl 196 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 197 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 198 | [_AM_PROG_TAR([v7])])]) 199 | _AM_IF_OPTION([no-dependencies],, 200 | [AC_PROVIDE_IFELSE([AC_PROG_CC], 201 | [_AM_DEPENDENCIES(CC)], 202 | [define([AC_PROG_CC], 203 | defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 204 | AC_PROVIDE_IFELSE([AC_PROG_CXX], 205 | [_AM_DEPENDENCIES(CXX)], 206 | [define([AC_PROG_CXX], 207 | defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 208 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], 209 | [_AM_DEPENDENCIES(OBJC)], 210 | [define([AC_PROG_OBJC], 211 | defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 212 | ]) 213 | _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 214 | dnl The `parallel-tests' driver may need to know about EXEEXT, so add the 215 | dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 216 | dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 217 | AC_CONFIG_COMMANDS_PRE(dnl 218 | [m4_provide_if([_AM_COMPILER_EXEEXT], 219 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 220 | ]) 221 | 222 | dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 223 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 224 | dnl mangled by Autoconf and run in a shell conditional statement. 225 | m4_define([_AC_COMPILER_EXEEXT], 226 | m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 227 | 228 | 229 | # When config.status generates a header, we must update the stamp-h file. 230 | # This file resides in the same directory as the config header 231 | # that is generated. The stamp files are numbered to have different names. 232 | 233 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 234 | # loop where config.status creates the headers, so we can generate 235 | # our stamp files there. 236 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 237 | [# Compute $1's index in $config_headers. 238 | _am_arg=$1 239 | _am_stamp_count=1 240 | for _am_header in $config_headers :; do 241 | case $_am_header in 242 | $_am_arg | $_am_arg:* ) 243 | break ;; 244 | * ) 245 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; 246 | esac 247 | done 248 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 249 | 250 | # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 251 | # 252 | # This file is free software; the Free Software Foundation 253 | # gives unlimited permission to copy and/or distribute it, 254 | # with or without modifications, as long as this notice is preserved. 255 | 256 | # AM_PROG_INSTALL_SH 257 | # ------------------ 258 | # Define $install_sh. 259 | AC_DEFUN([AM_PROG_INSTALL_SH], 260 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 261 | if test x"${install_sh}" != xset; then 262 | case $am_aux_dir in 263 | *\ * | *\ *) 264 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 265 | *) 266 | install_sh="\${SHELL} $am_aux_dir/install-sh" 267 | esac 268 | fi 269 | AC_SUBST(install_sh)]) 270 | 271 | # Copyright (C) 2003, 2005 Free Software Foundation, Inc. 272 | # 273 | # This file is free software; the Free Software Foundation 274 | # gives unlimited permission to copy and/or distribute it, 275 | # with or without modifications, as long as this notice is preserved. 276 | 277 | # serial 2 278 | 279 | # Check whether the underlying file-system supports filenames 280 | # with a leading dot. For instance MS-DOS doesn't. 281 | AC_DEFUN([AM_SET_LEADING_DOT], 282 | [rm -rf .tst 2>/dev/null 283 | mkdir .tst 2>/dev/null 284 | if test -d .tst; then 285 | am__leading_dot=. 286 | else 287 | am__leading_dot=_ 288 | fi 289 | rmdir .tst 2>/dev/null 290 | AC_SUBST([am__leading_dot])]) 291 | 292 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 293 | 294 | # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 295 | # Free Software Foundation, Inc. 296 | # 297 | # This file is free software; the Free Software Foundation 298 | # gives unlimited permission to copy and/or distribute it, 299 | # with or without modifications, as long as this notice is preserved. 300 | 301 | # serial 6 302 | 303 | # AM_MISSING_PROG(NAME, PROGRAM) 304 | # ------------------------------ 305 | AC_DEFUN([AM_MISSING_PROG], 306 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) 307 | $1=${$1-"${am_missing_run}$2"} 308 | AC_SUBST($1)]) 309 | 310 | 311 | # AM_MISSING_HAS_RUN 312 | # ------------------ 313 | # Define MISSING if not defined so far and test if it supports --run. 314 | # If it does, set am_missing_run to use it, otherwise, to nothing. 315 | AC_DEFUN([AM_MISSING_HAS_RUN], 316 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 317 | AC_REQUIRE_AUX_FILE([missing])dnl 318 | if test x"${MISSING+set}" != xset; then 319 | case $am_aux_dir in 320 | *\ * | *\ *) 321 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 322 | *) 323 | MISSING="\${SHELL} $am_aux_dir/missing" ;; 324 | esac 325 | fi 326 | # Use eval to expand $SHELL 327 | if eval "$MISSING --run true"; then 328 | am_missing_run="$MISSING --run " 329 | else 330 | am_missing_run= 331 | AC_MSG_WARN([`missing' script is too old or missing]) 332 | fi 333 | ]) 334 | 335 | # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 336 | # 337 | # This file is free software; the Free Software Foundation 338 | # gives unlimited permission to copy and/or distribute it, 339 | # with or without modifications, as long as this notice is preserved. 340 | 341 | # AM_PROG_MKDIR_P 342 | # --------------- 343 | # Check for `mkdir -p'. 344 | AC_DEFUN([AM_PROG_MKDIR_P], 345 | [AC_PREREQ([2.60])dnl 346 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl 347 | dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 348 | dnl while keeping a definition of mkdir_p for backward compatibility. 349 | dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 350 | dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 351 | dnl Makefile.ins that do not define MKDIR_P, so we do our own 352 | dnl adjustment using top_builddir (which is defined more often than 353 | dnl MKDIR_P). 354 | AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 355 | case $mkdir_p in 356 | [[\\/$]]* | ?:[[\\/]]*) ;; 357 | */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 358 | esac 359 | ]) 360 | 361 | # Helper functions for option handling. -*- Autoconf -*- 362 | 363 | # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 364 | # 365 | # This file is free software; the Free Software Foundation 366 | # gives unlimited permission to copy and/or distribute it, 367 | # with or without modifications, as long as this notice is preserved. 368 | 369 | # serial 4 370 | 371 | # _AM_MANGLE_OPTION(NAME) 372 | # ----------------------- 373 | AC_DEFUN([_AM_MANGLE_OPTION], 374 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 375 | 376 | # _AM_SET_OPTION(NAME) 377 | # ------------------------------ 378 | # Set option NAME. Presently that only means defining a flag for this option. 379 | AC_DEFUN([_AM_SET_OPTION], 380 | [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 381 | 382 | # _AM_SET_OPTIONS(OPTIONS) 383 | # ---------------------------------- 384 | # OPTIONS is a space-separated list of Automake options. 385 | AC_DEFUN([_AM_SET_OPTIONS], 386 | [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 387 | 388 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 389 | # ------------------------------------------- 390 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 391 | AC_DEFUN([_AM_IF_OPTION], 392 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 393 | 394 | # Check to make sure that the build environment is sane. -*- Autoconf -*- 395 | 396 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 397 | # Free Software Foundation, Inc. 398 | # 399 | # This file is free software; the Free Software Foundation 400 | # gives unlimited permission to copy and/or distribute it, 401 | # with or without modifications, as long as this notice is preserved. 402 | 403 | # serial 5 404 | 405 | # AM_SANITY_CHECK 406 | # --------------- 407 | AC_DEFUN([AM_SANITY_CHECK], 408 | [AC_MSG_CHECKING([whether build environment is sane]) 409 | # Just in case 410 | sleep 1 411 | echo timestamp > conftest.file 412 | # Reject unsafe characters in $srcdir or the absolute working directory 413 | # name. Accept space and tab only in the latter. 414 | am_lf=' 415 | ' 416 | case `pwd` in 417 | *[[\\\"\#\$\&\'\`$am_lf]]*) 418 | AC_MSG_ERROR([unsafe absolute working directory name]);; 419 | esac 420 | case $srcdir in 421 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 422 | AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 423 | esac 424 | 425 | # Do `set' in a subshell so we don't clobber the current shell's 426 | # arguments. Must try -L first in case configure is actually a 427 | # symlink; some systems play weird games with the mod time of symlinks 428 | # (eg FreeBSD returns the mod time of the symlink's containing 429 | # directory). 430 | if ( 431 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 432 | if test "$[*]" = "X"; then 433 | # -L didn't work. 434 | set X `ls -t "$srcdir/configure" conftest.file` 435 | fi 436 | rm -f conftest.file 437 | if test "$[*]" != "X $srcdir/configure conftest.file" \ 438 | && test "$[*]" != "X conftest.file $srcdir/configure"; then 439 | 440 | # If neither matched, then we have a broken ls. This can happen 441 | # if, for instance, CONFIG_SHELL is bash and it inherits a 442 | # broken ls alias from the environment. This has actually 443 | # happened. Such a system could not be considered "sane". 444 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 445 | alias in your environment]) 446 | fi 447 | 448 | test "$[2]" = conftest.file 449 | ) 450 | then 451 | # Ok. 452 | : 453 | else 454 | AC_MSG_ERROR([newly created file is older than distributed files! 455 | Check your system clock]) 456 | fi 457 | AC_MSG_RESULT(yes)]) 458 | 459 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 460 | # 461 | # This file is free software; the Free Software Foundation 462 | # gives unlimited permission to copy and/or distribute it, 463 | # with or without modifications, as long as this notice is preserved. 464 | 465 | # AM_PROG_INSTALL_STRIP 466 | # --------------------- 467 | # One issue with vendor `install' (even GNU) is that you can't 468 | # specify the program used to strip binaries. This is especially 469 | # annoying in cross-compiling environments, where the build's strip 470 | # is unlikely to handle the host's binaries. 471 | # Fortunately install-sh will honor a STRIPPROG variable, so we 472 | # always use install-sh in `make install-strip', and initialize 473 | # STRIPPROG with the value of the STRIP variable (set by the user). 474 | AC_DEFUN([AM_PROG_INSTALL_STRIP], 475 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 476 | # Installed binaries are usually stripped using `strip' when the user 477 | # run `make install-strip'. However `strip' might not be the right 478 | # tool to use in cross-compilation environments, therefore Automake 479 | # will honor the `STRIP' environment variable to overrule this program. 480 | dnl Don't test for $cross_compiling = yes, because it might be `maybe'. 481 | if test "$cross_compiling" != no; then 482 | AC_CHECK_TOOL([STRIP], [strip], :) 483 | fi 484 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 485 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) 486 | 487 | # Copyright (C) 2006, 2008 Free Software Foundation, Inc. 488 | # 489 | # This file is free software; the Free Software Foundation 490 | # gives unlimited permission to copy and/or distribute it, 491 | # with or without modifications, as long as this notice is preserved. 492 | 493 | # serial 2 494 | 495 | # _AM_SUBST_NOTMAKE(VARIABLE) 496 | # --------------------------- 497 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 498 | # This macro is traced by Automake. 499 | AC_DEFUN([_AM_SUBST_NOTMAKE]) 500 | 501 | # AM_SUBST_NOTMAKE(VARIABLE) 502 | # --------------------------- 503 | # Public sister of _AM_SUBST_NOTMAKE. 504 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 505 | 506 | # Check how to create a tarball. -*- Autoconf -*- 507 | 508 | # Copyright (C) 2004, 2005 Free Software Foundation, Inc. 509 | # 510 | # This file is free software; the Free Software Foundation 511 | # gives unlimited permission to copy and/or distribute it, 512 | # with or without modifications, as long as this notice is preserved. 513 | 514 | # serial 2 515 | 516 | # _AM_PROG_TAR(FORMAT) 517 | # -------------------- 518 | # Check how to create a tarball in format FORMAT. 519 | # FORMAT should be one of `v7', `ustar', or `pax'. 520 | # 521 | # Substitute a variable $(am__tar) that is a command 522 | # writing to stdout a FORMAT-tarball containing the directory 523 | # $tardir. 524 | # tardir=directory && $(am__tar) > result.tar 525 | # 526 | # Substitute a variable $(am__untar) that extract such 527 | # a tarball read from stdin. 528 | # $(am__untar) < result.tar 529 | AC_DEFUN([_AM_PROG_TAR], 530 | [# Always define AMTAR for backward compatibility. 531 | AM_MISSING_PROG([AMTAR], [tar]) 532 | m4_if([$1], [v7], 533 | [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 534 | [m4_case([$1], [ustar],, [pax],, 535 | [m4_fatal([Unknown tar format])]) 536 | AC_MSG_CHECKING([how to create a $1 tar archive]) 537 | # Loop over all known methods to create a tar archive until one works. 538 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 539 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} 540 | # Do not fold the above two line into one, because Tru64 sh and 541 | # Solaris sh will not grok spaces in the rhs of `-'. 542 | for _am_tool in $_am_tools 543 | do 544 | case $_am_tool in 545 | gnutar) 546 | for _am_tar in tar gnutar gtar; 547 | do 548 | AM_RUN_LOG([$_am_tar --version]) && break 549 | done 550 | am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 551 | am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 552 | am__untar="$_am_tar -xf -" 553 | ;; 554 | plaintar) 555 | # Must skip GNU tar: if it does not support --format= it doesn't create 556 | # ustar tarball either. 557 | (tar --version) >/dev/null 2>&1 && continue 558 | am__tar='tar chf - "$$tardir"' 559 | am__tar_='tar chf - "$tardir"' 560 | am__untar='tar xf -' 561 | ;; 562 | pax) 563 | am__tar='pax -L -x $1 -w "$$tardir"' 564 | am__tar_='pax -L -x $1 -w "$tardir"' 565 | am__untar='pax -r' 566 | ;; 567 | cpio) 568 | am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 569 | am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 570 | am__untar='cpio -i -H $1 -d' 571 | ;; 572 | none) 573 | am__tar=false 574 | am__tar_=false 575 | am__untar=false 576 | ;; 577 | esac 578 | 579 | # If the value was cached, stop now. We just wanted to have am__tar 580 | # and am__untar set. 581 | test -n "${am_cv_prog_tar_$1}" && break 582 | 583 | # tar/untar a dummy directory, and stop if the command works 584 | rm -rf conftest.dir 585 | mkdir conftest.dir 586 | echo GrepMe > conftest.dir/file 587 | AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 588 | rm -rf conftest.dir 589 | if test -s conftest.tar; then 590 | AM_RUN_LOG([$am__untar /dev/null 2>&1 && break 592 | fi 593 | done 594 | rm -rf conftest.dir 595 | 596 | AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 597 | AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 598 | AC_SUBST([am__tar]) 599 | AC_SUBST([am__untar]) 600 | ]) # _AM_PROG_TAR 601 | 602 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 | # Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | pkgdatadir = $(datadir)/@PACKAGE@ 20 | pkgincludedir = $(includedir)/@PACKAGE@ 21 | pkglibdir = $(libdir)/@PACKAGE@ 22 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 24 | install_sh_DATA = $(install_sh) -c -m 644 25 | install_sh_PROGRAM = $(install_sh) -c 26 | install_sh_SCRIPT = $(install_sh) -c 27 | INSTALL_HEADER = $(INSTALL_DATA) 28 | transform = $(program_transform_name) 29 | NORMAL_INSTALL = : 30 | PRE_INSTALL = : 31 | POST_INSTALL = : 32 | NORMAL_UNINSTALL = : 33 | PRE_UNINSTALL = : 34 | POST_UNINSTALL = : 35 | subdir = . 36 | DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \ 37 | $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ 38 | $(top_srcdir)/configure install-sh missing 39 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 40 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 41 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 42 | $(ACLOCAL_M4) 43 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 44 | configure.lineno config.status.lineno 45 | mkinstalldirs = $(install_sh) -d 46 | CONFIG_CLEAN_FILES = 47 | CONFIG_CLEAN_VPATH_FILES = 48 | SOURCES = 49 | DIST_SOURCES = 50 | RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ 51 | html-recursive info-recursive install-data-recursive \ 52 | install-dvi-recursive install-exec-recursive \ 53 | install-html-recursive install-info-recursive \ 54 | install-pdf-recursive install-ps-recursive install-recursive \ 55 | installcheck-recursive installdirs-recursive pdf-recursive \ 56 | ps-recursive uninstall-recursive 57 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 58 | am__vpath_adj = case $$p in \ 59 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 60 | *) f=$$p;; \ 61 | esac; 62 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 63 | am__install_max = 40 64 | am__nobase_strip_setup = \ 65 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 66 | am__nobase_strip = \ 67 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 68 | am__nobase_list = $(am__nobase_strip_setup); \ 69 | for p in $$list; do echo "$$p $$p"; done | \ 70 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 71 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 72 | if (++n[$$2] == $(am__install_max)) \ 73 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 74 | END { for (dir in files) print dir, files[dir] }' 75 | am__base_list = \ 76 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 77 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 78 | am__installdirs = "$(DESTDIR)$(docdir)" 79 | DATA = $(dist_doc_DATA) 80 | RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 81 | distclean-recursive maintainer-clean-recursive 82 | AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ 83 | $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ 84 | distdir dist dist-all distcheck 85 | ETAGS = etags 86 | CTAGS = ctags 87 | DIST_SUBDIRS = $(SUBDIRS) 88 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 89 | distdir = $(PACKAGE)-$(VERSION) 90 | top_distdir = $(distdir) 91 | am__remove_distdir = \ 92 | { test ! -d "$(distdir)" \ 93 | || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 94 | && rm -fr "$(distdir)"; }; } 95 | am__relativize = \ 96 | dir0=`pwd`; \ 97 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ 98 | sed_rest='s,^[^/]*/*,,'; \ 99 | sed_last='s,^.*/\([^/]*\)$$,\1,'; \ 100 | sed_butlast='s,/*[^/]*$$,,'; \ 101 | while test -n "$$dir1"; do \ 102 | first=`echo "$$dir1" | sed -e "$$sed_first"`; \ 103 | if test "$$first" != "."; then \ 104 | if test "$$first" = ".."; then \ 105 | dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ 106 | dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ 107 | else \ 108 | first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ 109 | if test "$$first2" = "$$first"; then \ 110 | dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ 111 | else \ 112 | dir2="../$$dir2"; \ 113 | fi; \ 114 | dir0="$$dir0"/"$$first"; \ 115 | fi; \ 116 | fi; \ 117 | dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ 118 | done; \ 119 | reldir="$$dir2" 120 | DIST_ARCHIVES = $(distdir).tar.gz 121 | GZIP_ENV = --best 122 | distuninstallcheck_listfiles = find . -type f -print 123 | distcleancheck_listfiles = find . -type f -print 124 | ACLOCAL = @ACLOCAL@ 125 | AMTAR = @AMTAR@ 126 | AUTOCONF = @AUTOCONF@ 127 | AUTOHEADER = @AUTOHEADER@ 128 | AUTOMAKE = @AUTOMAKE@ 129 | AWK = @AWK@ 130 | CYGPATH_W = @CYGPATH_W@ 131 | DEFS = @DEFS@ 132 | ECHO_C = @ECHO_C@ 133 | ECHO_N = @ECHO_N@ 134 | ECHO_T = @ECHO_T@ 135 | INSTALL = @INSTALL@ 136 | INSTALL_DATA = @INSTALL_DATA@ 137 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 138 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 139 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 140 | LIBOBJS = @LIBOBJS@ 141 | LIBS = @LIBS@ 142 | LTLIBOBJS = @LTLIBOBJS@ 143 | MAKEINFO = @MAKEINFO@ 144 | MKDIR_P = @MKDIR_P@ 145 | PACKAGE = @PACKAGE@ 146 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 147 | PACKAGE_NAME = @PACKAGE_NAME@ 148 | PACKAGE_STRING = @PACKAGE_STRING@ 149 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 150 | PACKAGE_URL = @PACKAGE_URL@ 151 | PACKAGE_VERSION = @PACKAGE_VERSION@ 152 | PATH_SEPARATOR = @PATH_SEPARATOR@ 153 | SET_MAKE = @SET_MAKE@ 154 | SHELL = @SHELL@ 155 | STRIP = @STRIP@ 156 | VERSION = @VERSION@ 157 | abs_builddir = @abs_builddir@ 158 | abs_srcdir = @abs_srcdir@ 159 | abs_top_builddir = @abs_top_builddir@ 160 | abs_top_srcdir = @abs_top_srcdir@ 161 | am__leading_dot = @am__leading_dot@ 162 | am__tar = @am__tar@ 163 | am__untar = @am__untar@ 164 | bindir = @bindir@ 165 | build_alias = @build_alias@ 166 | builddir = @builddir@ 167 | datadir = @datadir@ 168 | datarootdir = @datarootdir@ 169 | docdir = @docdir@ 170 | dvidir = @dvidir@ 171 | exec_prefix = @exec_prefix@ 172 | host_alias = @host_alias@ 173 | htmldir = @htmldir@ 174 | includedir = @includedir@ 175 | infodir = @infodir@ 176 | install_sh = @install_sh@ 177 | libdir = @libdir@ 178 | libexecdir = @libexecdir@ 179 | localedir = @localedir@ 180 | localstatedir = @localstatedir@ 181 | mandir = @mandir@ 182 | mkdir_p = @mkdir_p@ 183 | oldincludedir = @oldincludedir@ 184 | pdfdir = @pdfdir@ 185 | prefix = @prefix@ 186 | program_transform_name = @program_transform_name@ 187 | psdir = @psdir@ 188 | sbindir = @sbindir@ 189 | sharedstatedir = @sharedstatedir@ 190 | srcdir = @srcdir@ 191 | subdirs = @subdirs@ 192 | sysconfdir = @sysconfdir@ 193 | target_alias = @target_alias@ 194 | top_build_prefix = @top_build_prefix@ 195 | top_builddir = @top_builddir@ 196 | top_srcdir = @top_srcdir@ 197 | SUBDIRS = src 198 | dist_doc_DATA = README.md 199 | all: all-recursive 200 | 201 | .SUFFIXES: 202 | am--refresh: 203 | @: 204 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 205 | @for dep in $?; do \ 206 | case '$(am__configure_deps)' in \ 207 | *$$dep*) \ 208 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ 209 | $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ 210 | && exit 0; \ 211 | exit 1;; \ 212 | esac; \ 213 | done; \ 214 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ 215 | $(am__cd) $(top_srcdir) && \ 216 | $(AUTOMAKE) --foreign Makefile 217 | .PRECIOUS: Makefile 218 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 219 | @case '$?' in \ 220 | *config.status*) \ 221 | echo ' $(SHELL) ./config.status'; \ 222 | $(SHELL) ./config.status;; \ 223 | *) \ 224 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 225 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 226 | esac; 227 | 228 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 229 | $(SHELL) ./config.status --recheck 230 | 231 | $(top_srcdir)/configure: $(am__configure_deps) 232 | $(am__cd) $(srcdir) && $(AUTOCONF) 233 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 234 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 235 | $(am__aclocal_m4_deps): 236 | install-dist_docDATA: $(dist_doc_DATA) 237 | @$(NORMAL_INSTALL) 238 | test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" 239 | @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ 240 | for p in $$list; do \ 241 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ 242 | echo "$$d$$p"; \ 243 | done | $(am__base_list) | \ 244 | while read files; do \ 245 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ 246 | $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ 247 | done 248 | 249 | uninstall-dist_docDATA: 250 | @$(NORMAL_UNINSTALL) 251 | @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ 252 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ 253 | test -n "$$files" || exit 0; \ 254 | echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ 255 | cd "$(DESTDIR)$(docdir)" && rm -f $$files 256 | 257 | # This directory's subdirectories are mostly independent; you can cd 258 | # into them and run `make' without going through this Makefile. 259 | # To change the values of `make' variables: instead of editing Makefiles, 260 | # (1) if the variable is set in `config.status', edit `config.status' 261 | # (which will cause the Makefiles to be regenerated when you run `make'); 262 | # (2) otherwise, pass the desired values on the `make' command line. 263 | $(RECURSIVE_TARGETS): 264 | @fail= failcom='exit 1'; \ 265 | for f in x $$MAKEFLAGS; do \ 266 | case $$f in \ 267 | *=* | --[!k]*);; \ 268 | *k*) failcom='fail=yes';; \ 269 | esac; \ 270 | done; \ 271 | dot_seen=no; \ 272 | target=`echo $@ | sed s/-recursive//`; \ 273 | list='$(SUBDIRS)'; for subdir in $$list; do \ 274 | echo "Making $$target in $$subdir"; \ 275 | if test "$$subdir" = "."; then \ 276 | dot_seen=yes; \ 277 | local_target="$$target-am"; \ 278 | else \ 279 | local_target="$$target"; \ 280 | fi; \ 281 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 282 | || eval $$failcom; \ 283 | done; \ 284 | if test "$$dot_seen" = "no"; then \ 285 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ 286 | fi; test -z "$$fail" 287 | 288 | $(RECURSIVE_CLEAN_TARGETS): 289 | @fail= failcom='exit 1'; \ 290 | for f in x $$MAKEFLAGS; do \ 291 | case $$f in \ 292 | *=* | --[!k]*);; \ 293 | *k*) failcom='fail=yes';; \ 294 | esac; \ 295 | done; \ 296 | dot_seen=no; \ 297 | case "$@" in \ 298 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ 299 | *) list='$(SUBDIRS)' ;; \ 300 | esac; \ 301 | rev=''; for subdir in $$list; do \ 302 | if test "$$subdir" = "."; then :; else \ 303 | rev="$$subdir $$rev"; \ 304 | fi; \ 305 | done; \ 306 | rev="$$rev ."; \ 307 | target=`echo $@ | sed s/-recursive//`; \ 308 | for subdir in $$rev; do \ 309 | echo "Making $$target in $$subdir"; \ 310 | if test "$$subdir" = "."; then \ 311 | local_target="$$target-am"; \ 312 | else \ 313 | local_target="$$target"; \ 314 | fi; \ 315 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ 316 | || eval $$failcom; \ 317 | done && test -z "$$fail" 318 | tags-recursive: 319 | list='$(SUBDIRS)'; for subdir in $$list; do \ 320 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ 321 | done 322 | ctags-recursive: 323 | list='$(SUBDIRS)'; for subdir in $$list; do \ 324 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ 325 | done 326 | 327 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 328 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 329 | unique=`for i in $$list; do \ 330 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 331 | done | \ 332 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 333 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 334 | mkid -fID $$unique 335 | tags: TAGS 336 | 337 | TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 338 | $(TAGS_FILES) $(LISP) 339 | set x; \ 340 | here=`pwd`; \ 341 | if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ 342 | include_option=--etags-include; \ 343 | empty_fix=.; \ 344 | else \ 345 | include_option=--include; \ 346 | empty_fix=; \ 347 | fi; \ 348 | list='$(SUBDIRS)'; for subdir in $$list; do \ 349 | if test "$$subdir" = .; then :; else \ 350 | test ! -f $$subdir/TAGS || \ 351 | set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ 352 | fi; \ 353 | done; \ 354 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 355 | unique=`for i in $$list; do \ 356 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 357 | done | \ 358 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 359 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 360 | shift; \ 361 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 362 | test -n "$$unique" || unique=$$empty_fix; \ 363 | if test $$# -gt 0; then \ 364 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 365 | "$$@" $$unique; \ 366 | else \ 367 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 368 | $$unique; \ 369 | fi; \ 370 | fi 371 | ctags: CTAGS 372 | CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 373 | $(TAGS_FILES) $(LISP) 374 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 375 | unique=`for i in $$list; do \ 376 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 377 | done | \ 378 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 379 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 380 | test -z "$(CTAGS_ARGS)$$unique" \ 381 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 382 | $$unique 383 | 384 | GTAGS: 385 | here=`$(am__cd) $(top_builddir) && pwd` \ 386 | && $(am__cd) $(top_srcdir) \ 387 | && gtags -i $(GTAGS_ARGS) "$$here" 388 | 389 | distclean-tags: 390 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 391 | 392 | distdir: $(DISTFILES) 393 | $(am__remove_distdir) 394 | test -d "$(distdir)" || mkdir "$(distdir)" 395 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 396 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 397 | list='$(DISTFILES)'; \ 398 | dist_files=`for file in $$list; do echo $$file; done | \ 399 | sed -e "s|^$$srcdirstrip/||;t" \ 400 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 401 | case $$dist_files in \ 402 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 403 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 404 | sort -u` ;; \ 405 | esac; \ 406 | for file in $$dist_files; do \ 407 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 408 | if test -d $$d/$$file; then \ 409 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 410 | if test -d "$(distdir)/$$file"; then \ 411 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 412 | fi; \ 413 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 414 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 415 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 416 | fi; \ 417 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 418 | else \ 419 | test -f "$(distdir)/$$file" \ 420 | || cp -p $$d/$$file "$(distdir)/$$file" \ 421 | || exit 1; \ 422 | fi; \ 423 | done 424 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 425 | if test "$$subdir" = .; then :; else \ 426 | test -d "$(distdir)/$$subdir" \ 427 | || $(MKDIR_P) "$(distdir)/$$subdir" \ 428 | || exit 1; \ 429 | fi; \ 430 | done 431 | @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ 432 | if test "$$subdir" = .; then :; else \ 433 | dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ 434 | $(am__relativize); \ 435 | new_distdir=$$reldir; \ 436 | dir1=$$subdir; dir2="$(top_distdir)"; \ 437 | $(am__relativize); \ 438 | new_top_distdir=$$reldir; \ 439 | echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ 440 | echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ 441 | ($(am__cd) $$subdir && \ 442 | $(MAKE) $(AM_MAKEFLAGS) \ 443 | top_distdir="$$new_top_distdir" \ 444 | distdir="$$new_distdir" \ 445 | am__remove_distdir=: \ 446 | am__skip_length_check=: \ 447 | am__skip_mode_fix=: \ 448 | distdir) \ 449 | || exit 1; \ 450 | fi; \ 451 | done 452 | -test -n "$(am__skip_mode_fix)" \ 453 | || find "$(distdir)" -type d ! -perm -755 \ 454 | -exec chmod u+rwx,go+rx {} \; -o \ 455 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 456 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 457 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 458 | || chmod -R a+r "$(distdir)" 459 | dist-gzip: distdir 460 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 461 | $(am__remove_distdir) 462 | 463 | dist-bzip2: distdir 464 | tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 465 | $(am__remove_distdir) 466 | 467 | dist-lzma: distdir 468 | tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma 469 | $(am__remove_distdir) 470 | 471 | dist-xz: distdir 472 | tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz 473 | $(am__remove_distdir) 474 | 475 | dist-tarZ: distdir 476 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 477 | $(am__remove_distdir) 478 | 479 | dist-shar: distdir 480 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 481 | $(am__remove_distdir) 482 | 483 | dist-zip: distdir 484 | -rm -f $(distdir).zip 485 | zip -rq $(distdir).zip $(distdir) 486 | $(am__remove_distdir) 487 | 488 | dist dist-all: distdir 489 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 490 | $(am__remove_distdir) 491 | 492 | # This target untars the dist file and tries a VPATH configuration. Then 493 | # it guarantees that the distribution is self-contained by making another 494 | # tarfile. 495 | distcheck: dist 496 | case '$(DIST_ARCHIVES)' in \ 497 | *.tar.gz*) \ 498 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 499 | *.tar.bz2*) \ 500 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 501 | *.tar.lzma*) \ 502 | lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ 503 | *.tar.xz*) \ 504 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 505 | *.tar.Z*) \ 506 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 507 | *.shar.gz*) \ 508 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 509 | *.zip*) \ 510 | unzip $(distdir).zip ;;\ 511 | esac 512 | chmod -R a-w $(distdir); chmod a+w $(distdir) 513 | mkdir $(distdir)/_build 514 | mkdir $(distdir)/_inst 515 | chmod a-w $(distdir) 516 | test -d $(distdir)/_build || exit 0; \ 517 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 518 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 519 | && am__cwd=`pwd` \ 520 | && $(am__cd) $(distdir)/_build \ 521 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 522 | $(DISTCHECK_CONFIGURE_FLAGS) \ 523 | && $(MAKE) $(AM_MAKEFLAGS) \ 524 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 525 | && $(MAKE) $(AM_MAKEFLAGS) check \ 526 | && $(MAKE) $(AM_MAKEFLAGS) install \ 527 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 528 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 529 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 530 | distuninstallcheck \ 531 | && chmod -R a-w "$$dc_install_base" \ 532 | && ({ \ 533 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 534 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 535 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 536 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 537 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 538 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 539 | && rm -rf "$$dc_destdir" \ 540 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 541 | && rm -rf $(DIST_ARCHIVES) \ 542 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 543 | && cd "$$am__cwd" \ 544 | || exit 1 545 | $(am__remove_distdir) 546 | @(echo "$(distdir) archives ready for distribution: "; \ 547 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 548 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 549 | distuninstallcheck: 550 | @$(am__cd) '$(distuninstallcheck_dir)' \ 551 | && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ 552 | || { echo "ERROR: files left after uninstall:" ; \ 553 | if test -n "$(DESTDIR)"; then \ 554 | echo " (check DESTDIR support)"; \ 555 | fi ; \ 556 | $(distuninstallcheck_listfiles) ; \ 557 | exit 1; } >&2 558 | distcleancheck: distclean 559 | @if test '$(srcdir)' = . ; then \ 560 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 561 | exit 1 ; \ 562 | fi 563 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 564 | || { echo "ERROR: files left in build directory after distclean:" ; \ 565 | $(distcleancheck_listfiles) ; \ 566 | exit 1; } >&2 567 | check-am: all-am 568 | check: check-recursive 569 | all-am: Makefile $(DATA) 570 | installdirs: installdirs-recursive 571 | installdirs-am: 572 | for dir in "$(DESTDIR)$(docdir)"; do \ 573 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 574 | done 575 | install: install-recursive 576 | install-exec: install-exec-recursive 577 | install-data: install-data-recursive 578 | uninstall: uninstall-recursive 579 | 580 | install-am: all-am 581 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 582 | 583 | installcheck: installcheck-recursive 584 | install-strip: 585 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 586 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 587 | `test -z '$(STRIP)' || \ 588 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 589 | mostlyclean-generic: 590 | 591 | clean-generic: 592 | 593 | distclean-generic: 594 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 595 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 596 | 597 | maintainer-clean-generic: 598 | @echo "This command is intended for maintainers to use" 599 | @echo "it deletes files that may require special tools to rebuild." 600 | clean: clean-recursive 601 | 602 | clean-am: clean-generic mostlyclean-am 603 | 604 | distclean: distclean-recursive 605 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 606 | -rm -f Makefile 607 | distclean-am: clean-am distclean-generic distclean-tags 608 | 609 | dvi: dvi-recursive 610 | 611 | dvi-am: 612 | 613 | html: html-recursive 614 | 615 | html-am: 616 | 617 | info: info-recursive 618 | 619 | info-am: 620 | 621 | install-data-am: install-dist_docDATA 622 | 623 | install-dvi: install-dvi-recursive 624 | 625 | install-dvi-am: 626 | 627 | install-exec-am: 628 | 629 | install-html: install-html-recursive 630 | 631 | install-html-am: 632 | 633 | install-info: install-info-recursive 634 | 635 | install-info-am: 636 | 637 | install-man: 638 | 639 | install-pdf: install-pdf-recursive 640 | 641 | install-pdf-am: 642 | 643 | install-ps: install-ps-recursive 644 | 645 | install-ps-am: 646 | 647 | installcheck-am: 648 | 649 | maintainer-clean: maintainer-clean-recursive 650 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 651 | -rm -rf $(top_srcdir)/autom4te.cache 652 | -rm -f Makefile 653 | maintainer-clean-am: distclean-am maintainer-clean-generic 654 | 655 | mostlyclean: mostlyclean-recursive 656 | 657 | mostlyclean-am: mostlyclean-generic 658 | 659 | pdf: pdf-recursive 660 | 661 | pdf-am: 662 | 663 | ps: ps-recursive 664 | 665 | ps-am: 666 | 667 | uninstall-am: uninstall-dist_docDATA 668 | 669 | .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ 670 | install-am install-strip tags-recursive 671 | 672 | .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ 673 | all all-am am--refresh check check-am clean clean-generic \ 674 | ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ 675 | dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ 676 | distclean distclean-generic distclean-tags distcleancheck \ 677 | distdir distuninstallcheck dvi dvi-am html html-am info \ 678 | info-am install install-am install-data install-data-am \ 679 | install-dist_docDATA install-dvi install-dvi-am install-exec \ 680 | install-exec-am install-html install-html-am install-info \ 681 | install-info-am install-man install-pdf install-pdf-am \ 682 | install-ps install-ps-am install-strip installcheck \ 683 | installcheck-am installdirs installdirs-am maintainer-clean \ 684 | maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ 685 | pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ 686 | uninstall-dist_docDATA 687 | 688 | 689 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 690 | # Otherwise a system limit (for SysV at least) may be exceeded. 691 | .NOEXPORT: 692 | -------------------------------------------------------------------------------- /src/auth.c: -------------------------------------------------------------------------------- 1 | /* File: auth.c 2 | * ------------ 3 | * 注:核心函数为Authentication(),由该函数执行801.1X认证 4 | */ 5 | 6 | // FOR CCNU 2012-10-9 Renew MD-5 For iNode PC 5.0 (E0101); 7 | 8 | int Authentication(const char *UserName, const char *Password, const char *DeviceName); 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include //转换编码所需 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "debug.h" 29 | 30 | // 自定义常量 31 | typedef enum {REQUEST=1, RESPONSE=2, SUCCESS=3, FAILURE=4, H3CDATA=10} EAP_Code; 32 | typedef enum {IDENTITY=1, NOTIFICATION=2, MD5=4, ALLOCATED=7, AVAILABLE=20} EAP_Type; //增加EAP_Type=7 33 | typedef uint8_t EAP_ID; 34 | const uint8_t BroadcastAddr[6] = {0xff,0xff,0xff,0xff,0xff,0xff}; // 广播MAC地址 35 | const uint8_t MultcastAddr[6] = {0x01,0x80,0xc2,0x00,0x00,0x03}; // 多播MAC地址 36 | const char H3C_VERSION[16]="EN V2.40-0335"; // 华为客户端版本号EN V2.40-0335 37 | const char H3C_KEY[] ="HuaWei3COM1X"; // H3C的固定密钥 38 | 39 | 40 | // 子函数声明 41 | static void SendStartPkt(pcap_t *adhandle, const uint8_t mac[]); 42 | static void SendLogoffPkt(pcap_t *adhandle, const uint8_t mac[]); 43 | static void SendResponseIdentity(pcap_t *adhandle, 44 | const uint8_t request[], 45 | const uint8_t ethhdr[], 46 | const uint8_t ip[4], 47 | const char username[]); 48 | static void SendResponseIdentityUserName(pcap_t *adhandle, 49 | const uint8_t request[], 50 | const uint8_t ethhdr[], 51 | const uint8_t ip[4], 52 | const char username[]); 53 | static void SendResponseMD5(pcap_t *adhandle, 54 | const uint8_t request[], 55 | const uint8_t ethhdr[], 56 | const char username[], 57 | const char passwd[]); 58 | static void SendResponsePassword(pcap_t *handle, 59 | const uint8_t request[], 60 | const uint8_t ethhdr[], 61 | const char username[], 62 | const char passwd[]); 63 | static void SendResponseAvailable(pcap_t *adhandle, 64 | const uint8_t request[], 65 | const uint8_t ethhdr[], 66 | const uint8_t ip[4], 67 | const char username[]); 68 | static void SendResponseNotification(pcap_t *handle, 69 | const uint8_t request[], 70 | const uint8_t ethhdr[]); 71 | 72 | static void GetMacFromDevice(uint8_t mac[6], const char *devicename); 73 | 74 | static void FillClientVersionArea(uint8_t area[]); 75 | static void FillWindowsVersionArea(uint8_t area[]); 76 | static void FillBase64Area(char area[]); 77 | // From fillmd5.c 78 | extern void FillMD5Area(uint8_t digest[], 79 | uint8_t id, const char passwd[], const uint8_t srcMD5[]); 80 | 81 | // From ip.c 82 | extern void GetIpFromDevice(uint8_t ip[4], const char DeviceName[]); 83 | 84 | 85 | 86 | /** 87 | * 函数:Authentication() 88 | * 89 | * 使用以太网进行802.1X认证(802.1X Authentication) 90 | * 该函数将不断循环,应答802.1X认证会话,直到遇到错误后才退出 91 | */ 92 | 93 | int Authentication(const char *UserName, const char *Password, const char *DeviceName) 94 | { 95 | char errbuf[PCAP_ERRBUF_SIZE]; 96 | pcap_t *adhandle; // adapter handle 97 | uint8_t MAC[6]; 98 | char FilterStr[100]; 99 | struct bpf_program fcode; 100 | const int DefaultTimeout=60000;//设置接收超时参数,单位ms 101 | int h3cdata = 0; 102 | 103 | // NOTE: 这里没有检查网线是否已插好,网线插口可能接触不良 104 | 105 | /* 打开适配器(网卡) */ 106 | adhandle = pcap_open_live(DeviceName,65536,1,DefaultTimeout,errbuf); 107 | if (adhandle==NULL) { 108 | fprintf(stderr, "%s\n", errbuf); 109 | exit(-1); 110 | } 111 | 112 | /* 查询本机MAC地址 */ 113 | GetMacFromDevice(MAC, DeviceName); 114 | 115 | /* 116 | * 设置过滤器: 117 | * 初始情况下只捕获发往本机的802.1X认证会话,不接收多播信息(避免误捕获其他客户端发出的多播信息) 118 | * 进入循环体前可以重设过滤器,那时再开始接收多播信息 119 | */ 120 | sprintf(FilterStr, "(ether proto 0x888e) and (ether dst host %02x:%02x:%02x:%02x:%02x:%02x)", 121 | MAC[0],MAC[1],MAC[2],MAC[3],MAC[4],MAC[5]); 122 | pcap_compile(adhandle, &fcode, FilterStr, 1, 0xff); 123 | pcap_setfilter(adhandle, &fcode); 124 | 125 | 126 | START_AUTHENTICATION: 127 | { 128 | int retcode; 129 | struct pcap_pkthdr *header; 130 | const uint8_t *captured; 131 | uint8_t ethhdr[14]={0}; // ethernet header 132 | uint8_t ip[4]={0}; // ip address 133 | 134 | /* 主动发起认证会话 */ 135 | SendStartPkt(adhandle, MAC); 136 | DPRINTF("[*] Client: Start!\n"); 137 | 138 | /* 等待认证服务器的回应 */ 139 | bool serverIsFound = false; 140 | while (!serverIsFound) 141 | { 142 | retcode = pcap_next_ex(adhandle, &header, &captured); 143 | if (retcode==1 && (EAP_Code)captured[18]==REQUEST) 144 | serverIsFound = true; 145 | else 146 | { // 延时后重试 147 | sleep(1); DPRINTF("[*] Waiting...\n"); 148 | SendStartPkt(adhandle, MAC); 149 | // NOTE: 这里没有检查网线是否接触不良或已被拔下 150 | } 151 | } 152 | 153 | // 填写应答包的报头(以后无须再修改) 154 | // 默认以单播方式应答802.1X认证设备发来的Request 155 | memcpy(ethhdr+0, captured+6, 6); 156 | memcpy(ethhdr+6, MAC, 6); 157 | ethhdr[12] = 0x88; 158 | ethhdr[13] = 0x8e; 159 | 160 | // 收到的第一个包可能是Request Notification。取决于校方网络配置 161 | if ((EAP_Type)captured[22] == NOTIFICATION) 162 | { 163 | DPRINTF("[%d] Server: Request Notification!\n", captured[19]); 164 | // 发送Response Notification 165 | SendResponseNotification(adhandle, captured, ethhdr); 166 | DPRINTF("[-] Client: Response Notification.\n"); 167 | 168 | // 继续接收下一个Request包 169 | retcode = pcap_next_ex(adhandle, &header, &captured); 170 | assert(retcode==1); 171 | assert((EAP_Code)captured[18] == REQUEST); 172 | } 173 | 174 | // 分情况应答下一个包 175 | if ((EAP_Type)captured[22] == IDENTITY) 176 | { // 通常情况会收到包Request Identity,应回答Response Identity 177 | DPRINTF("[%d] Server: Request Identity!\n", captured[19]); 178 | GetIpFromDevice(ip, DeviceName); 179 | SendResponseIdentityUserName(adhandle, captured, ethhdr, ip, UserName); 180 | DPRINTF("[%d] Client: Response Identity-UserName:[%s]!\n", (EAP_ID)captured[19],UserName);//增加打印用户名 181 | } 182 | else if ((EAP_Type)captured[22] == AVAILABLE) 183 | { // 遇到AVAILABLE包时需要特殊处理 184 | // 中南财经政法大学目前使用的格式: 185 | // 收到第一个Request AVAILABLE时要回答Response Identity 186 | DPRINTF("[%d] Server: Request AVAILABLE!\n", captured[19]); 187 | GetIpFromDevice(ip, DeviceName); 188 | SendResponseIdentity(adhandle, captured, ethhdr, ip, UserName); 189 | DPRINTF("[%d] Client: Response Identity.\n", (EAP_ID)captured[19]); 190 | } 191 | 192 | // 重设过滤器,只捕获华为802.1X认证设备发来的包(包括多播Request Identity / Request AVAILABLE) 193 | sprintf(FilterStr, "(ether proto 0x888e) and (ether src host %02x:%02x:%02x:%02x:%02x:%02x)", 194 | captured[6],captured[7],captured[8],captured[9],captured[10],captured[11]); 195 | pcap_compile(adhandle, &fcode, FilterStr, 1, 0xff); 196 | pcap_setfilter(adhandle, &fcode); 197 | 198 | // 进入循环体 199 | for (;;) 200 | { 201 | // 调用pcap_next_ex()函数捕获数据包 202 | int sleepTime = 0; 203 | while (pcap_next_ex(adhandle, &header, &captured) != 1) 204 | { 205 | DPRINTF("."); // 若捕获失败,则等1秒后重试 206 | sleep(1); 207 | ++sleepTime; 208 | if(sleepTime >= 3) 209 | goto START_AUTHENTICATION;//三次捕获失败则重新认证 210 | // NOTE: 这里没有检查网线是否已被拔下或插口接触不良 211 | } 212 | 213 | // 根据收到的Request,回复相应的Response包 214 | if ((EAP_Code)captured[18] == REQUEST) 215 | { 216 | switch ((EAP_Type)captured[22]) 217 | { 218 | case IDENTITY: 219 | DPRINTF("[%d] Server: Request Identity!\n", (EAP_ID)captured[19]); 220 | GetIpFromDevice(ip, DeviceName); 221 | SendResponseIdentity(adhandle, captured, ethhdr, ip, UserName); 222 | DPRINTF("[%d] Client: Response Identity.\n", (EAP_ID)captured[19]); 223 | break; 224 | case AVAILABLE: 225 | DPRINTF("[%d] Server: Request AVAILABLE!\n", (EAP_ID)captured[19]); 226 | GetIpFromDevice(ip, DeviceName); 227 | SendResponseAvailable(adhandle, captured, ethhdr, ip, UserName); 228 | DPRINTF("[%d] Client: Response AVAILABLE.\n", (EAP_ID)captured[19]); 229 | break; 230 | case MD5: 231 | DPRINTF("[%d] Server: Request MD5-Challenge!\n", (EAP_ID)captured[19]); 232 | SendResponseMD5(adhandle, captured, ethhdr, UserName, Password); 233 | DPRINTF("[%d] Client: Response MD5-Challenge.\n", (EAP_ID)captured[19]); 234 | break; 235 | case ALLOCATED: //newtype:7;EAP_REQUEST ALLOCATED PACKAGE; 236 | DPRINTF("[%d] Server: Request Allocated(Password)!\n", (EAP_ID)captured[19]); 237 | SendResponsePassword(adhandle, captured, ethhdr, UserName, Password); //Send Password; 238 | DPRINTF("[%d] Client: Response Allocated(Password).\n", (EAP_ID)captured[19]); 239 | break; 240 | case NOTIFICATION: 241 | DPRINTF("[%d] Server: Request Notification!\n", captured[19]); 242 | SendResponseNotification(adhandle, captured, ethhdr); 243 | DPRINTF("[-] Client: Response Notification.\n"); 244 | break; 245 | default: 246 | DPRINTF("[%d] Server: Request (type:%d)!\n", (EAP_ID)captured[19], (EAP_Type)captured[22]); 247 | DPRINTF("Error! Unexpected request type.\n"); 248 | exit(-1); 249 | break; 250 | } 251 | } 252 | else if ((EAP_Code)captured[18] == FAILURE) 253 | { // 处理认证失败信息 254 | uint8_t errtype = captured[22]; 255 | uint8_t msgsize = captured[23]; 256 | const char *msg = (const char*) &captured[24]; 257 | DPRINTF("[*] Server: Failure!\n"); 258 | if (errtype==0x09 && msgsize>0) 259 | { // 输出错误提示消息 260 | fprintf(stderr, "%s\n", msg); 261 | // 已知的几种错误如下 262 | // E2531:用户名不存在 263 | // E2535:Service is paused 264 | // E2542:该用户帐号已经在别处登录 265 | // E2547:接入时段限制 266 | // E2553:密码错误 267 | // E2602:认证会话不存在 268 | // E3137:客户端版本号无效 269 | exit(-1); 270 | } 271 | else if (errtype==0x08) // 可能网络无流量时服务器结束此次802.1X认证会话 272 | { // 遇此情况客户端立刻发起新的认证会话 273 | DPRINTF("[*] Waiting...\n"); 274 | sleep(1); 275 | goto START_AUTHENTICATION; 276 | } 277 | else 278 | { 279 | DPRINTF("errtype=0x%02x\n", errtype); 280 | exit(-1); 281 | } 282 | } 283 | else if ((EAP_Code)captured[18] == SUCCESS) 284 | { 285 | DPRINTF("[*] Server: Success!\n"); 286 | // 刷新IP地址 287 | //system("Reflesh-IP"); 288 | } 289 | else 290 | { 291 | uint8_t msgsize = captured[21]; 292 | char *H3Cmsg = (char*) &captured[26]; 293 | DPRINTF("[%d] Server: ", captured[19]); 294 | 295 | //接收客户端提示文字并转为utf8编码 296 | iconv_t cd = iconv_open("utf-8","gbk"); 297 | size_t h3clen = msgsize; 298 | size_t translen = h3clen *4; 299 | char *transMsg = (char*)malloc(translen * sizeof(char)); 300 | memset(transMsg,0,translen); 301 | char *outputMsg = transMsg; 302 | //若转换成功则输出utf8编码,否则输出原编码 303 | if(iconv(cd,&H3Cmsg,&h3clen,&transMsg,&translen) != -1){ 304 | outputMsg[translen] = '\0'; 305 | fprintf(stdout, "%s\n", outputMsg); 306 | } 307 | else 308 | fprintf(stdout, "%s\n", H3Cmsg); 309 | iconv_close(cd); 310 | } 311 | } 312 | } 313 | return (0); 314 | } 315 | 316 | 317 | 318 | static 319 | void GetMacFromDevice(uint8_t mac[6], const char *devicename) 320 | { 321 | 322 | int fd; 323 | int err; 324 | struct ifreq ifr; 325 | 326 | fd = socket(PF_PACKET, SOCK_RAW, htons(0x0806)); 327 | assert(fd != -1); 328 | 329 | assert(strlen(devicename) < IFNAMSIZ); 330 | strncpy(ifr.ifr_name, devicename, IFNAMSIZ); 331 | ifr.ifr_addr.sa_family = AF_INET; 332 | 333 | err = ioctl(fd, SIOCGIFHWADDR, &ifr); 334 | assert(err != -1); 335 | memcpy(mac, ifr.ifr_hwaddr.sa_data, 6); 336 | 337 | err = close(fd); 338 | assert(err != -1); 339 | return; 340 | } 341 | 342 | 343 | static 344 | void SendStartPkt(pcap_t *handle, const uint8_t localmac[]) 345 | { 346 | uint8_t packet[18]; 347 | 348 | // Ethernet Header (14 Bytes) 349 | memcpy(packet, BroadcastAddr, 6); 350 | memcpy(packet+6, localmac, 6); 351 | packet[12] = 0x88; 352 | packet[13] = 0x8e; 353 | 354 | // EAPOL (4 Bytes) 355 | packet[14] = 0x01; // Version=1 356 | packet[15] = 0x01; // Type=Start 357 | packet[16] = packet[17] =0x00;// Length=0x0000 358 | 359 | // 为了兼容不同院校的网络配置,这里发送两遍Start包 360 | // 1、广播发送Strat包 361 | pcap_sendpacket(handle, packet, sizeof(packet)); 362 | // 2、多播发送Strat包 363 | //sysu为广播触发 364 | memcpy(packet, MultcastAddr, 6); 365 | pcap_sendpacket(handle, packet, sizeof(packet)); 366 | } 367 | 368 | 369 | static 370 | void SendResponseAvailable(pcap_t *handle, const uint8_t request[], const uint8_t ethhdr[], const uint8_t ip[4], const char username[]) 371 | { 372 | int i; 373 | uint16_t eaplen; 374 | int usernamelen; 375 | uint8_t response[128]; 376 | 377 | assert((EAP_Code)request[18] == REQUEST); 378 | assert((EAP_Type)request[22] == AVAILABLE); 379 | 380 | // Fill Ethernet header 381 | memcpy(response, ethhdr, 14); 382 | 383 | // 802.1X Authentication 384 | // { 385 | response[14] = 0x1; // 802.1X Version 1 386 | response[15] = 0x0; // Type=0 (EAP Packet) 387 | //response[16~17]留空 // Length 388 | 389 | // Extensible Authentication Protocol 390 | // { 391 | response[18] = (EAP_Code) RESPONSE; // Code 392 | response[19] = request[19]; // ID 393 | //response[20~21]留空 // Length 394 | response[22] = (EAP_Type) AVAILABLE; // Type 395 | // Type-Data 396 | // { 397 | i = 23; 398 | response[i++] = 0x00;// 上报是否使用代理 399 | response[i++] = 0x15; // 上传IP地址 400 | response[i++] = 0x04; // 401 | memcpy(response+i, ip, 4);// 402 | i += 4; // 403 | response[i++] = 0x06; // 携带版本号 404 | response[i++] = 0x07; // 405 | FillBase64Area((char*)response+i);// 406 | i += 28; // 407 | response[i++] = ' '; // 两个空格符 408 | response[i++] = ' '; // 409 | usernamelen = strlen(username); 410 | memcpy(response+i, username, usernamelen);// 411 | i += usernamelen; // 412 | // } 413 | // } 414 | // } 415 | 416 | // 补填前面留空的两处Length 417 | eaplen = htons(i-18); 418 | memcpy(response+16, &eaplen, sizeof(eaplen)); 419 | memcpy(response+20, &eaplen, sizeof(eaplen)); 420 | 421 | // 发送 422 | pcap_sendpacket(handle, response, i); 423 | } 424 | 425 | 426 | static 427 | void SendResponseIdentity(pcap_t *adhandle, const uint8_t request[], const uint8_t ethhdr[], const uint8_t ip[4], const char username[]) 428 | { 429 | uint8_t response[128]; 430 | size_t i; 431 | uint16_t eaplen; 432 | int usernamelen; 433 | 434 | assert((EAP_Code)request[18] == REQUEST); 435 | assert((EAP_Type)request[22] == IDENTITY 436 | ||(EAP_Type)request[22] == AVAILABLE); // 兼容中南财经政法大学情况 437 | 438 | // Fill Ethernet header 439 | memcpy(response, ethhdr, 14); 440 | 441 | // 802.1X Authentication 442 | // { 443 | response[14] = 0x1; // 802.1X Version 1 444 | response[15] = 0x0; // Type=0 (EAP Packet) 445 | //response[16~17]留空 // Length 446 | 447 | // Extensible Authentication Protocol 448 | // { 449 | response[18] = (EAP_Code) RESPONSE; // Code 450 | response[19] = request[19]; // ID 451 | //response[20~21]留空 // Length 452 | response[22] = (EAP_Type) IDENTITY; // Type 453 | // Type-Data 454 | // { 455 | i = 23; 456 | response[i++] = 0x15; // 上传IP地址 457 | response[i++] = 0x04; // 458 | memcpy(response+i, ip, 4);// 459 | i += 4; // 460 | response[i++] = 0x06; // 携带版本号 461 | response[i++] = 0x07; // 462 | //FillBase64Area((char*)response+i);//for zhyaof 463 | memcpy(response+i, "bjQ7SE8BZ3MqHhs3clMregcDY3Y=", sizeof("bjQ7SE8BZ3MqHhs3clMregcDY3Y=")); 464 | i += 28; // 465 | response[i++] = ' '; // 两个空格符 466 | response[i++] = ' '; // 467 | usernamelen = strlen(username); //末尾添加用户名 468 | memcpy(response+i, username, usernamelen); 469 | i += usernamelen; 470 | assert(i <= sizeof(response)); 471 | // } 472 | // } 473 | // } 474 | 475 | // 补填前面留空的两处Length 476 | eaplen = htons(i-18); 477 | memcpy(response+16, &eaplen, sizeof(eaplen)); 478 | memcpy(response+20, &eaplen, sizeof(eaplen)); 479 | 480 | // 发送 481 | pcap_sendpacket(adhandle, response, i); 482 | return; 483 | } 484 | 485 | static 486 | void SendResponseIdentityUserName(pcap_t *adhandle, const uint8_t request[], const uint8_t ethhdr[], const uint8_t ip[4], const char username[]) 487 | { 488 | uint8_t response[128]; 489 | size_t i; 490 | uint16_t eaplen; 491 | int usernamelen; 492 | 493 | assert((EAP_Code)request[18] == REQUEST); 494 | assert((EAP_Type)request[22] == IDENTITY 495 | ||(EAP_Type)request[22] == AVAILABLE); // 兼容中南财经政法大学情况 496 | 497 | // Fill Ethernet header 498 | memcpy(response, ethhdr, 14); 499 | 500 | // 802.1X Authentication 501 | // { 502 | response[14] = 0x1; // 802.1X Version 1 503 | response[15] = 0x0; // Type=0 (EAP Packet) 504 | //response[16~17]留空 // Length 505 | 506 | // Extensible Authentication Protocol 507 | // { 508 | response[18] = (EAP_Code) RESPONSE; // Code 509 | response[19] = request[19]; // ID 510 | //response[20~21]留空 // Length 511 | response[22] = (EAP_Type) IDENTITY; // Type 512 | // Type-Data 513 | // { 514 | i = 23; 515 | response[i++] = 0x06; // 携带版本号 516 | response[i++] = 0x07; // 517 | memcpy(response+i, "bjQ7SE8BZ3MqHhs3clMregcDY3Y=", sizeof("bjQ7SE8BZ3MqHhs3clMregcDY3Y=")); 518 | i += 28; // 519 | response[i++] = ' '; // 两个空格符 520 | response[i++] = ' '; // 521 | 522 | //memcpy(response+i, "bjQ7SE8BZ3MqHhs3clMregcDY3Y=", sizeof("bjQ7SE8BZ3MqHhs3clMregcDY3Y=")); 523 | usernamelen = strlen(username); //末尾添加用户名 524 | memcpy(response+i, username, usernamelen); 525 | // } 526 | // } 527 | // } 528 | 529 | // 补填前面留空的两处Length 530 | eaplen = htons(usernamelen + 0x25); 531 | memcpy(response+16, &eaplen, sizeof(eaplen)); 532 | memcpy(response+20, &eaplen, sizeof(eaplen)); 533 | 534 | // 发送 535 | pcap_sendpacket(adhandle, response, 55+usernamelen); 536 | return; 537 | } 538 | 539 | static 540 | void SendResponseMD5(pcap_t *handle, const uint8_t request[], const uint8_t ethhdr[], const char username[], const char passwd[]) 541 | { 542 | uint16_t eaplen; 543 | size_t usernamelen; 544 | size_t packetlen; 545 | size_t passwdlen; 546 | uint8_t response[128]; 547 | 548 | assert((EAP_Code)request[18] == REQUEST); 549 | assert((EAP_Type)request[22] == MD5); 550 | 551 | usernamelen = strlen(username); 552 | passwdlen = strlen(passwd); 553 | eaplen = htons(22+usernamelen); 554 | packetlen = 14+4+22+usernamelen; // ethhdr+EAPOL+EAP+usernamelen 555 | 556 | // Fill Ethernet header 557 | memcpy(response, ethhdr, 14); 558 | 559 | // 802.1X Authentication 560 | // { 561 | response[14] = 0x1; // 802.1X Version 1 562 | response[15] = 0x0; // Type=0 (EAP Packet) 563 | memcpy(response+16, &eaplen, sizeof(eaplen)); // Length 564 | 565 | // Extensible Authentication Protocol 566 | // { 567 | response[18] = (EAP_Code) RESPONSE;// Code 568 | response[19] = request[19]; // ID 569 | response[20] = response[16]; // Length 570 | response[21] = response[17]; // 571 | response[22] = (EAP_Type) MD5; // Type 572 | response[23] = 16; // Value-Size: 16 Bytes 573 | 574 | 575 | uint8_t md5[16]; 576 | int jj=0; 577 | size_t kk=passwdlen; 578 | int ll=0; 579 | 580 | for(;jj>2 ]; 778 | area[j++] = Tbl[((c1&0x03)<<4)|((c2&0xf0)>>4) ]; 779 | area[j++] = Tbl[ ((c2&0x0f)<<2)|((c3&0xc0)>>6)]; 780 | area[j++] = Tbl[ c3&0x3f ]; 781 | } 782 | c1 = version[i++]; 783 | c2 = version[i++]; 784 | area[24] = Tbl[ (c1&0xfc)>>2 ]; 785 | area[25] = Tbl[((c1&0x03)<<4)|((c2&0xf0)>>4)]; 786 | area[26] = Tbl[ ((c2&0x0f)<<2)]; 787 | area[27] = '='; 788 | } 789 | 790 | -------------------------------------------------------------------------------- /src/Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 | # Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | VPATH = @srcdir@ 19 | pkgdatadir = $(datadir)/@PACKAGE@ 20 | pkgincludedir = $(includedir)/@PACKAGE@ 21 | pkglibdir = $(libdir)/@PACKAGE@ 22 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 24 | install_sh_DATA = $(install_sh) -c -m 644 25 | install_sh_PROGRAM = $(install_sh) -c 26 | install_sh_SCRIPT = $(install_sh) -c 27 | INSTALL_HEADER = $(INSTALL_DATA) 28 | transform = $(program_transform_name) 29 | NORMAL_INSTALL = : 30 | PRE_INSTALL = : 31 | POST_INSTALL = : 32 | NORMAL_UNINSTALL = : 33 | PRE_UNINSTALL = : 34 | POST_UNINSTALL = : 35 | sbin_PROGRAMS = client$(EXEEXT) 36 | subdir = . 37 | DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ 38 | $(srcdir)/Makefile.in $(srcdir)/config.h.in \ 39 | $(top_srcdir)/configure depcomp install-sh missing 40 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 41 | am__aclocal_m4_deps = $(top_srcdir)/m4/tcpdump-aclocal.m4 \ 42 | $(top_srcdir)/configure.ac 43 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 44 | $(ACLOCAL_M4) 45 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 46 | configure.lineno config.status.lineno 47 | mkinstalldirs = $(install_sh) -d 48 | CONFIG_HEADER = config.h 49 | CONFIG_CLEAN_FILES = 50 | CONFIG_CLEAN_VPATH_FILES = 51 | am__installdirs = "$(DESTDIR)$(sbindir)" 52 | PROGRAMS = $(sbin_PROGRAMS) 53 | am_client_OBJECTS = client-main.$(OBJEXT) client-auth.$(OBJEXT) \ 54 | client-ip.$(OBJEXT) client-fillmd5-libcrypto.$(OBJEXT) \ 55 | client-njit8021xclient.$(OBJEXT) 56 | client_OBJECTS = $(am_client_OBJECTS) 57 | am__DEPENDENCIES_1 = 58 | client_DEPENDENCIES = $(am__DEPENDENCIES_1) 59 | client_LINK = $(CCLD) $(client_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ 60 | $(LDFLAGS) -o $@ 61 | DEFAULT_INCLUDES = -I.@am__isrc@ 62 | depcomp = $(SHELL) $(top_srcdir)/depcomp 63 | am__depfiles_maybe = depfiles 64 | am__mv = mv -f 65 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 66 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 67 | CCLD = $(CC) 68 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 69 | SOURCES = $(client_SOURCES) 70 | DIST_SOURCES = $(client_SOURCES) 71 | ETAGS = etags 72 | CTAGS = ctags 73 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 74 | distdir = $(PACKAGE)-$(VERSION) 75 | top_distdir = $(distdir) 76 | am__remove_distdir = \ 77 | { test ! -d "$(distdir)" \ 78 | || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 79 | && rm -fr "$(distdir)"; }; } 80 | DIST_ARCHIVES = $(distdir).tar.gz 81 | GZIP_ENV = --best 82 | distuninstallcheck_listfiles = find . -type f -print 83 | distcleancheck_listfiles = find . -type f -print 84 | ACLOCAL = @ACLOCAL@ 85 | AMTAR = @AMTAR@ 86 | AUTOCONF = @AUTOCONF@ 87 | AUTOHEADER = @AUTOHEADER@ 88 | AUTOMAKE = @AUTOMAKE@ 89 | AWK = @AWK@ 90 | CC = @CC@ 91 | CCDEPMODE = @CCDEPMODE@ 92 | CFLAGS = @CFLAGS@ 93 | CPPFLAGS = @CPPFLAGS@ 94 | CYGPATH_W = @CYGPATH_W@ 95 | DEFS = $(V_DEFS) 96 | DEPDIR = @DEPDIR@ 97 | ECHO_C = @ECHO_C@ 98 | ECHO_N = @ECHO_N@ 99 | ECHO_T = @ECHO_T@ 100 | EXEEXT = @EXEEXT@ 101 | INSTALL = @INSTALL@ 102 | INSTALL_DATA = @INSTALL_DATA@ 103 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 104 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 105 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 106 | LDFLAGS = @LDFLAGS@ 107 | LIBOBJS = @LIBOBJS@ 108 | LIBS = @LIBS@ 109 | LTLIBOBJS = @LTLIBOBJS@ 110 | MAKEINFO = @MAKEINFO@ 111 | MKDIR_P = @MKDIR_P@ 112 | OBJEXT = @OBJEXT@ 113 | PACKAGE = @PACKAGE@ 114 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 115 | PACKAGE_NAME = @PACKAGE_NAME@ 116 | PACKAGE_STRING = @PACKAGE_STRING@ 117 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 118 | PACKAGE_URL = @PACKAGE_URL@ 119 | PACKAGE_VERSION = @PACKAGE_VERSION@ 120 | PATH_SEPARATOR = @PATH_SEPARATOR@ 121 | PCAP_CONFIG = @PCAP_CONFIG@ 122 | PKG_CONFIG = @PKG_CONFIG@ 123 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ 124 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ 125 | SET_MAKE = @SET_MAKE@ 126 | SHELL = @SHELL@ 127 | SHLICC2 = @SHLICC2@ 128 | STRIP = @STRIP@ 129 | VERSION = @VERSION@ 130 | V_CCOPT = @V_CCOPT@ 131 | V_DEFS = @V_DEFS@ 132 | V_GROUP = @V_GROUP@ 133 | V_INCLS = @V_INCLS@ 134 | V_PCAPDEP = @V_PCAPDEP@ 135 | abs_builddir = @abs_builddir@ 136 | abs_srcdir = @abs_srcdir@ 137 | abs_top_builddir = @abs_top_builddir@ 138 | abs_top_srcdir = @abs_top_srcdir@ 139 | ac_ct_CC = @ac_ct_CC@ 140 | am__include = @am__include@ 141 | am__leading_dot = @am__leading_dot@ 142 | am__quote = @am__quote@ 143 | am__tar = @am__tar@ 144 | am__untar = @am__untar@ 145 | bindir = @bindir@ 146 | build_alias = @build_alias@ 147 | builddir = @builddir@ 148 | datadir = @datadir@ 149 | datarootdir = @datarootdir@ 150 | docdir = @docdir@ 151 | dvidir = @dvidir@ 152 | exec_prefix = @exec_prefix@ 153 | host_alias = @host_alias@ 154 | htmldir = @htmldir@ 155 | includedir = @includedir@ 156 | infodir = @infodir@ 157 | install_sh = @install_sh@ 158 | libcrypto_CFLAGS = @libcrypto_CFLAGS@ 159 | libcrypto_LIBS = @libcrypto_LIBS@ 160 | libdir = @libdir@ 161 | libexecdir = @libexecdir@ 162 | localedir = @localedir@ 163 | localstatedir = @localstatedir@ 164 | mandir = @mandir@ 165 | mkdir_p = @mkdir_p@ 166 | oldincludedir = @oldincludedir@ 167 | pdfdir = @pdfdir@ 168 | prefix = @prefix@ 169 | program_transform_name = @program_transform_name@ 170 | psdir = @psdir@ 171 | sbindir = @sbindir@ 172 | sharedstatedir = @sharedstatedir@ 173 | srcdir = @srcdir@ 174 | sysconfdir = @sysconfdir@ 175 | target_alias = @target_alias@ 176 | top_build_prefix = @top_build_prefix@ 177 | top_builddir = @top_builddir@ 178 | top_srcdir = @top_srcdir@ 179 | ACLOCAL_AMFLAGS = -I m4 180 | client_SOURCES = \ 181 | main.c \ 182 | auth.c \ 183 | ip.c \ 184 | fillmd5-libcrypto.c \ 185 | njit8021xclient.c \ 186 | njit8021xclient.h \ 187 | debug.h \ 188 | $(NULL) 189 | 190 | CCOPT = $(V_CCOPT) 191 | INCLS = $(V_INCLS) 192 | client_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(libcrypto_CFLAGS) 193 | client_LDADD = $(LBL_LIBS) $(libcrypto_LIBS) 194 | all: config.h 195 | $(MAKE) $(AM_MAKEFLAGS) all-am 196 | 197 | .SUFFIXES: 198 | .SUFFIXES: .c .o .obj 199 | am--refresh: 200 | @: 201 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 202 | @for dep in $?; do \ 203 | case '$(am__configure_deps)' in \ 204 | *$$dep*) \ 205 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ 206 | $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ 207 | && exit 0; \ 208 | exit 1;; \ 209 | esac; \ 210 | done; \ 211 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ 212 | $(am__cd) $(top_srcdir) && \ 213 | $(AUTOMAKE) --foreign Makefile 214 | .PRECIOUS: Makefile 215 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 216 | @case '$?' in \ 217 | *config.status*) \ 218 | echo ' $(SHELL) ./config.status'; \ 219 | $(SHELL) ./config.status;; \ 220 | *) \ 221 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 222 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 223 | esac; 224 | 225 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 226 | $(SHELL) ./config.status --recheck 227 | 228 | $(top_srcdir)/configure: $(am__configure_deps) 229 | $(am__cd) $(srcdir) && $(AUTOCONF) 230 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 231 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 232 | $(am__aclocal_m4_deps): 233 | 234 | config.h: stamp-h1 235 | @if test ! -f $@; then \ 236 | rm -f stamp-h1; \ 237 | $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ 238 | else :; fi 239 | 240 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status 241 | @rm -f stamp-h1 242 | cd $(top_builddir) && $(SHELL) ./config.status config.h 243 | $(srcdir)/config.h.in: $(am__configure_deps) 244 | ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) 245 | rm -f stamp-h1 246 | touch $@ 247 | 248 | distclean-hdr: 249 | -rm -f config.h stamp-h1 250 | install-sbinPROGRAMS: $(sbin_PROGRAMS) 251 | @$(NORMAL_INSTALL) 252 | test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" 253 | @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ 254 | for p in $$list; do echo "$$p $$p"; done | \ 255 | sed 's/$(EXEEXT)$$//' | \ 256 | while read p p1; do if test -f $$p; \ 257 | then echo "$$p"; echo "$$p"; else :; fi; \ 258 | done | \ 259 | sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ 260 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 261 | sed 'N;N;N;s,\n, ,g' | \ 262 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 263 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 264 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ 265 | else { print "f", $$3 "/" $$4, $$1; } } \ 266 | END { for (d in files) print "f", d, files[d] }' | \ 267 | while read type dir files; do \ 268 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 269 | test -z "$$files" || { \ 270 | echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ 271 | $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ 272 | } \ 273 | ; done 274 | 275 | uninstall-sbinPROGRAMS: 276 | @$(NORMAL_UNINSTALL) 277 | @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ 278 | files=`for p in $$list; do echo "$$p"; done | \ 279 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 280 | -e 's/$$/$(EXEEXT)/' `; \ 281 | test -n "$$list" || exit 0; \ 282 | echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ 283 | cd "$(DESTDIR)$(sbindir)" && rm -f $$files 284 | 285 | clean-sbinPROGRAMS: 286 | -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) 287 | client$(EXEEXT): $(client_OBJECTS) $(client_DEPENDENCIES) 288 | @rm -f client$(EXEEXT) 289 | $(client_LINK) $(client_OBJECTS) $(client_LDADD) $(LIBS) 290 | 291 | mostlyclean-compile: 292 | -rm -f *.$(OBJEXT) 293 | 294 | distclean-compile: 295 | -rm -f *.tab.c 296 | 297 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-auth.Po@am__quote@ 298 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-fillmd5-libcrypto.Po@am__quote@ 299 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-ip.Po@am__quote@ 300 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-main.Po@am__quote@ 301 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-njit8021xclient.Po@am__quote@ 302 | 303 | .c.o: 304 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 305 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 306 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 307 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 308 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< 309 | 310 | .c.obj: 311 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 312 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 313 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 314 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 315 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 316 | 317 | client-main.o: main.c 318 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-main.o -MD -MP -MF $(DEPDIR)/client-main.Tpo -c -o client-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c 319 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-main.Tpo $(DEPDIR)/client-main.Po 320 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='client-main.o' libtool=no @AMDEPBACKSLASH@ 321 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 322 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c 323 | 324 | client-main.obj: main.c 325 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-main.obj -MD -MP -MF $(DEPDIR)/client-main.Tpo -c -o client-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` 326 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-main.Tpo $(DEPDIR)/client-main.Po 327 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='client-main.obj' libtool=no @AMDEPBACKSLASH@ 328 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 329 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` 330 | 331 | client-auth.o: auth.c 332 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-auth.o -MD -MP -MF $(DEPDIR)/client-auth.Tpo -c -o client-auth.o `test -f 'auth.c' || echo '$(srcdir)/'`auth.c 333 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-auth.Tpo $(DEPDIR)/client-auth.Po 334 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='auth.c' object='client-auth.o' libtool=no @AMDEPBACKSLASH@ 335 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 336 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-auth.o `test -f 'auth.c' || echo '$(srcdir)/'`auth.c 337 | 338 | client-auth.obj: auth.c 339 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-auth.obj -MD -MP -MF $(DEPDIR)/client-auth.Tpo -c -o client-auth.obj `if test -f 'auth.c'; then $(CYGPATH_W) 'auth.c'; else $(CYGPATH_W) '$(srcdir)/auth.c'; fi` 340 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-auth.Tpo $(DEPDIR)/client-auth.Po 341 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='auth.c' object='client-auth.obj' libtool=no @AMDEPBACKSLASH@ 342 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 343 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-auth.obj `if test -f 'auth.c'; then $(CYGPATH_W) 'auth.c'; else $(CYGPATH_W) '$(srcdir)/auth.c'; fi` 344 | 345 | client-ip.o: ip.c 346 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-ip.o -MD -MP -MF $(DEPDIR)/client-ip.Tpo -c -o client-ip.o `test -f 'ip.c' || echo '$(srcdir)/'`ip.c 347 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-ip.Tpo $(DEPDIR)/client-ip.Po 348 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ip.c' object='client-ip.o' libtool=no @AMDEPBACKSLASH@ 349 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 350 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-ip.o `test -f 'ip.c' || echo '$(srcdir)/'`ip.c 351 | 352 | client-ip.obj: ip.c 353 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-ip.obj -MD -MP -MF $(DEPDIR)/client-ip.Tpo -c -o client-ip.obj `if test -f 'ip.c'; then $(CYGPATH_W) 'ip.c'; else $(CYGPATH_W) '$(srcdir)/ip.c'; fi` 354 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-ip.Tpo $(DEPDIR)/client-ip.Po 355 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ip.c' object='client-ip.obj' libtool=no @AMDEPBACKSLASH@ 356 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 357 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-ip.obj `if test -f 'ip.c'; then $(CYGPATH_W) 'ip.c'; else $(CYGPATH_W) '$(srcdir)/ip.c'; fi` 358 | 359 | client-fillmd5-libcrypto.o: fillmd5-libcrypto.c 360 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-fillmd5-libcrypto.o -MD -MP -MF $(DEPDIR)/client-fillmd5-libcrypto.Tpo -c -o client-fillmd5-libcrypto.o `test -f 'fillmd5-libcrypto.c' || echo '$(srcdir)/'`fillmd5-libcrypto.c 361 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-fillmd5-libcrypto.Tpo $(DEPDIR)/client-fillmd5-libcrypto.Po 362 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fillmd5-libcrypto.c' object='client-fillmd5-libcrypto.o' libtool=no @AMDEPBACKSLASH@ 363 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 364 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-fillmd5-libcrypto.o `test -f 'fillmd5-libcrypto.c' || echo '$(srcdir)/'`fillmd5-libcrypto.c 365 | 366 | client-fillmd5-libcrypto.obj: fillmd5-libcrypto.c 367 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-fillmd5-libcrypto.obj -MD -MP -MF $(DEPDIR)/client-fillmd5-libcrypto.Tpo -c -o client-fillmd5-libcrypto.obj `if test -f 'fillmd5-libcrypto.c'; then $(CYGPATH_W) 'fillmd5-libcrypto.c'; else $(CYGPATH_W) '$(srcdir)/fillmd5-libcrypto.c'; fi` 368 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-fillmd5-libcrypto.Tpo $(DEPDIR)/client-fillmd5-libcrypto.Po 369 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fillmd5-libcrypto.c' object='client-fillmd5-libcrypto.obj' libtool=no @AMDEPBACKSLASH@ 370 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 371 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-fillmd5-libcrypto.obj `if test -f 'fillmd5-libcrypto.c'; then $(CYGPATH_W) 'fillmd5-libcrypto.c'; else $(CYGPATH_W) '$(srcdir)/fillmd5-libcrypto.c'; fi` 372 | 373 | client-njit8021xclient.o: njit8021xclient.c 374 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-njit8021xclient.o -MD -MP -MF $(DEPDIR)/client-njit8021xclient.Tpo -c -o client-njit8021xclient.o `test -f 'njit8021xclient.c' || echo '$(srcdir)/'`njit8021xclient.c 375 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-njit8021xclient.Tpo $(DEPDIR)/client-njit8021xclient.Po 376 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='njit8021xclient.c' object='client-njit8021xclient.o' libtool=no @AMDEPBACKSLASH@ 377 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 378 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-njit8021xclient.o `test -f 'njit8021xclient.c' || echo '$(srcdir)/'`njit8021xclient.c 379 | 380 | client-njit8021xclient.obj: njit8021xclient.c 381 | @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -MT client-njit8021xclient.obj -MD -MP -MF $(DEPDIR)/client-njit8021xclient.Tpo -c -o client-njit8021xclient.obj `if test -f 'njit8021xclient.c'; then $(CYGPATH_W) 'njit8021xclient.c'; else $(CYGPATH_W) '$(srcdir)/njit8021xclient.c'; fi` 382 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/client-njit8021xclient.Tpo $(DEPDIR)/client-njit8021xclient.Po 383 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='njit8021xclient.c' object='client-njit8021xclient.obj' libtool=no @AMDEPBACKSLASH@ 384 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 385 | @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(client_CFLAGS) $(CFLAGS) -c -o client-njit8021xclient.obj `if test -f 'njit8021xclient.c'; then $(CYGPATH_W) 'njit8021xclient.c'; else $(CYGPATH_W) '$(srcdir)/njit8021xclient.c'; fi` 386 | 387 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 388 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 389 | unique=`for i in $$list; do \ 390 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 391 | done | \ 392 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 393 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 394 | mkid -fID $$unique 395 | tags: TAGS 396 | 397 | TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 398 | $(TAGS_FILES) $(LISP) 399 | set x; \ 400 | here=`pwd`; \ 401 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 402 | unique=`for i in $$list; do \ 403 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 404 | done | \ 405 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 406 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 407 | shift; \ 408 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 409 | test -n "$$unique" || unique=$$empty_fix; \ 410 | if test $$# -gt 0; then \ 411 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 412 | "$$@" $$unique; \ 413 | else \ 414 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 415 | $$unique; \ 416 | fi; \ 417 | fi 418 | ctags: CTAGS 419 | CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 420 | $(TAGS_FILES) $(LISP) 421 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 422 | unique=`for i in $$list; do \ 423 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 424 | done | \ 425 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 426 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 427 | test -z "$(CTAGS_ARGS)$$unique" \ 428 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 429 | $$unique 430 | 431 | GTAGS: 432 | here=`$(am__cd) $(top_builddir) && pwd` \ 433 | && $(am__cd) $(top_srcdir) \ 434 | && gtags -i $(GTAGS_ARGS) "$$here" 435 | 436 | distclean-tags: 437 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 438 | 439 | distdir: $(DISTFILES) 440 | $(am__remove_distdir) 441 | test -d "$(distdir)" || mkdir "$(distdir)" 442 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 443 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 444 | list='$(DISTFILES)'; \ 445 | dist_files=`for file in $$list; do echo $$file; done | \ 446 | sed -e "s|^$$srcdirstrip/||;t" \ 447 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 448 | case $$dist_files in \ 449 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 450 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 451 | sort -u` ;; \ 452 | esac; \ 453 | for file in $$dist_files; do \ 454 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 455 | if test -d $$d/$$file; then \ 456 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 457 | if test -d "$(distdir)/$$file"; then \ 458 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 459 | fi; \ 460 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 461 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 462 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 463 | fi; \ 464 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 465 | else \ 466 | test -f "$(distdir)/$$file" \ 467 | || cp -p $$d/$$file "$(distdir)/$$file" \ 468 | || exit 1; \ 469 | fi; \ 470 | done 471 | -test -n "$(am__skip_mode_fix)" \ 472 | || find "$(distdir)" -type d ! -perm -755 \ 473 | -exec chmod u+rwx,go+rx {} \; -o \ 474 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 475 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 476 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 477 | || chmod -R a+r "$(distdir)" 478 | dist-gzip: distdir 479 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 480 | $(am__remove_distdir) 481 | 482 | dist-bzip2: distdir 483 | tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 484 | $(am__remove_distdir) 485 | 486 | dist-lzma: distdir 487 | tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma 488 | $(am__remove_distdir) 489 | 490 | dist-xz: distdir 491 | tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz 492 | $(am__remove_distdir) 493 | 494 | dist-tarZ: distdir 495 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 496 | $(am__remove_distdir) 497 | 498 | dist-shar: distdir 499 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 500 | $(am__remove_distdir) 501 | 502 | dist-zip: distdir 503 | -rm -f $(distdir).zip 504 | zip -rq $(distdir).zip $(distdir) 505 | $(am__remove_distdir) 506 | 507 | dist dist-all: distdir 508 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 509 | $(am__remove_distdir) 510 | 511 | # This target untars the dist file and tries a VPATH configuration. Then 512 | # it guarantees that the distribution is self-contained by making another 513 | # tarfile. 514 | distcheck: dist 515 | case '$(DIST_ARCHIVES)' in \ 516 | *.tar.gz*) \ 517 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 518 | *.tar.bz2*) \ 519 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 520 | *.tar.lzma*) \ 521 | lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ 522 | *.tar.xz*) \ 523 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 524 | *.tar.Z*) \ 525 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 526 | *.shar.gz*) \ 527 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 528 | *.zip*) \ 529 | unzip $(distdir).zip ;;\ 530 | esac 531 | chmod -R a-w $(distdir); chmod a+w $(distdir) 532 | mkdir $(distdir)/_build 533 | mkdir $(distdir)/_inst 534 | chmod a-w $(distdir) 535 | test -d $(distdir)/_build || exit 0; \ 536 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 537 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 538 | && am__cwd=`pwd` \ 539 | && $(am__cd) $(distdir)/_build \ 540 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 541 | $(DISTCHECK_CONFIGURE_FLAGS) \ 542 | && $(MAKE) $(AM_MAKEFLAGS) \ 543 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 544 | && $(MAKE) $(AM_MAKEFLAGS) check \ 545 | && $(MAKE) $(AM_MAKEFLAGS) install \ 546 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 547 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 548 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 549 | distuninstallcheck \ 550 | && chmod -R a-w "$$dc_install_base" \ 551 | && ({ \ 552 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 553 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 554 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 555 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 556 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 557 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 558 | && rm -rf "$$dc_destdir" \ 559 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 560 | && rm -rf $(DIST_ARCHIVES) \ 561 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 562 | && cd "$$am__cwd" \ 563 | || exit 1 564 | $(am__remove_distdir) 565 | @(echo "$(distdir) archives ready for distribution: "; \ 566 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 567 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 568 | distuninstallcheck: 569 | @$(am__cd) '$(distuninstallcheck_dir)' \ 570 | && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ 571 | || { echo "ERROR: files left after uninstall:" ; \ 572 | if test -n "$(DESTDIR)"; then \ 573 | echo " (check DESTDIR support)"; \ 574 | fi ; \ 575 | $(distuninstallcheck_listfiles) ; \ 576 | exit 1; } >&2 577 | distcleancheck: distclean 578 | @if test '$(srcdir)' = . ; then \ 579 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 580 | exit 1 ; \ 581 | fi 582 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 583 | || { echo "ERROR: files left in build directory after distclean:" ; \ 584 | $(distcleancheck_listfiles) ; \ 585 | exit 1; } >&2 586 | check-am: all-am 587 | check: check-am 588 | all-am: Makefile $(PROGRAMS) config.h 589 | installdirs: 590 | for dir in "$(DESTDIR)$(sbindir)"; do \ 591 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 592 | done 593 | install: install-am 594 | install-exec: install-exec-am 595 | install-data: install-data-am 596 | uninstall: uninstall-am 597 | 598 | install-am: all-am 599 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 600 | 601 | installcheck: installcheck-am 602 | install-strip: 603 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 604 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 605 | `test -z '$(STRIP)' || \ 606 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 607 | mostlyclean-generic: 608 | 609 | clean-generic: 610 | 611 | distclean-generic: 612 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 613 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 614 | 615 | maintainer-clean-generic: 616 | @echo "This command is intended for maintainers to use" 617 | @echo "it deletes files that may require special tools to rebuild." 618 | clean: clean-am 619 | 620 | clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am 621 | 622 | distclean: distclean-am 623 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 624 | -rm -rf ./$(DEPDIR) 625 | -rm -f Makefile 626 | distclean-am: clean-am distclean-compile distclean-generic \ 627 | distclean-hdr distclean-tags 628 | 629 | dvi: dvi-am 630 | 631 | dvi-am: 632 | 633 | html: html-am 634 | 635 | html-am: 636 | 637 | info: info-am 638 | 639 | info-am: 640 | 641 | install-data-am: 642 | 643 | install-dvi: install-dvi-am 644 | 645 | install-dvi-am: 646 | 647 | install-exec-am: install-sbinPROGRAMS 648 | 649 | install-html: install-html-am 650 | 651 | install-html-am: 652 | 653 | install-info: install-info-am 654 | 655 | install-info-am: 656 | 657 | install-man: 658 | 659 | install-pdf: install-pdf-am 660 | 661 | install-pdf-am: 662 | 663 | install-ps: install-ps-am 664 | 665 | install-ps-am: 666 | 667 | installcheck-am: 668 | 669 | maintainer-clean: maintainer-clean-am 670 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 671 | -rm -rf $(top_srcdir)/autom4te.cache 672 | -rm -rf ./$(DEPDIR) 673 | -rm -f Makefile 674 | maintainer-clean-am: distclean-am maintainer-clean-generic 675 | 676 | mostlyclean: mostlyclean-am 677 | 678 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 679 | 680 | pdf: pdf-am 681 | 682 | pdf-am: 683 | 684 | ps: ps-am 685 | 686 | ps-am: 687 | 688 | uninstall-am: uninstall-sbinPROGRAMS 689 | 690 | .MAKE: all install-am install-strip 691 | 692 | .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ 693 | clean-generic clean-sbinPROGRAMS ctags dist dist-all \ 694 | dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz \ 695 | dist-zip distcheck distclean distclean-compile \ 696 | distclean-generic distclean-hdr distclean-tags distcleancheck \ 697 | distdir distuninstallcheck dvi dvi-am html html-am info \ 698 | info-am install install-am install-data install-data-am \ 699 | install-dvi install-dvi-am install-exec install-exec-am \ 700 | install-html install-html-am install-info install-info-am \ 701 | install-man install-pdf install-pdf-am install-ps \ 702 | install-ps-am install-sbinPROGRAMS install-strip installcheck \ 703 | installcheck-am installdirs maintainer-clean \ 704 | maintainer-clean-generic mostlyclean mostlyclean-compile \ 705 | mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ 706 | uninstall-am uninstall-sbinPROGRAMS 707 | 708 | 709 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 710 | # Otherwise a system limit (for SysV at least) may be exceeded. 711 | .NOEXPORT: 712 | --------------------------------------------------------------------------------