?? configure.in
字號(hào):
dnl Process this file with autoconf to produce a configure script.dnl Configuration input file for LK.dnl vi: set tabstop=4 shiftwidth=4:dnl $Id: configure.in,v 1.53 2000/09/17 04:24:57 neto Exp neto $dnl Copyright (C) 1997 David Netodnl dnl This program is free software; you can redistribute it and/or modifydnl it under the terms of the GNU General Public License as published bydnl the Free Software Foundation; either version 2, or (at your option)dnl any later version.dnl dnl This program is distributed in the hope that it will be useful,dnl but WITHOUT ANY WARRANTY; without even the implied warranty ofdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See thednl GNU General Public License for more details.dnl dnl You should have received a copy of the GNU General Public Licensednl along with this program; if not, write to the Free Softwarednl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MAdnl 02111-1307, USA.dnl Prologue ###########################################AC_INIT(src/lk.w)AC_REVISION($Revision: 1.53 $)dnlAC_PREREQ(2.12)dnl This was written in conjunction with Autoconf 2.12.dnl Initialize Automake 1.3AM_INIT_AUTOMAKE(lk,0.5.0)dnl PACKAGE=lk AC_SUBST(PACKAGE)dnl Be Win32-friendly, at least for Cygwin32 installations.AC_CYGWINdnl Must create config.h.in (Maybe use autoheader) dnl (Put config.h in AC_OUTPUT macro?) No.AM_CONFIG_HEADER(config.h) dnl Default place for installation. Without this, the default is /usr/localAC_PREFIX_DEFAULT(/home/neto/lk)dnl We use VERSION_STRING within the progs.AC_DEFINE_UNQUOTED(VERSION_STRING,"$VERSION")dnl Allow configuration on AIX by enabling certain BSD library functions.dnl (This may or may not define _ALL_SOURCE.)dnl AC_AIXdnl Determine host type; defines host_cpu, host_vendor, host_os, amongdnl other things.AC_CANONICAL_HOSTdnl Checks for programs ###############################AC_PROG_CCdnl SGI boxes, use the SGI compiler and -xansiif test $GCC = yes; then C_DIALECT="-ansi -pedantic" C_WARNINGS="-Wall -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes"else C_DIALECT="" C_WARNINGS=""fiCFLAGS="$C_DIALECT $C_WARNINGS $CFLAGS"AC_SUBST(CFLAGS)dnl The scripts that process output from LK require Perl and Bashdnl I also use a Perl script to post-process literate Pizza programsAC_PATH_PROG(PERL,perl)AC_PATH_PROG(BASH,bash)dnl CWEB programs ctangle and cweave are optional since C, Pizza, and Javadnl sources are included. dnl But to modify the source and recompile, you really should have CWEB. :)dnl TeX is required to make dvi documentation.dnl TEXINPUTS is inherited from the user's environment at TeX time.dnl mp is MetaPost, for figures.AC_PATH_PROG(CTANGLE,ctangle)AC_PATH_PROG(CWEAVE,cweave)AC_PATH_PROG(TEX,tex)AC_PATH_PROG(LATEX,latex2e)if test -z "$LATEX"; then AC_PATH_PROG(LATEX,latex)fiAC_PATH_PROG(DVIPS,dvips)if test -z "$DVIPS"; then AC_PATH_PROG(DVIPS,dvipsk)fiAC_PATH_PROG(MP,mp)dnl For CWEB programs, -bhp turns off banner, happy, progress outputdnl But put CWEAVEFLAGS and CTANGLEFLAGS after the default flags sodnl the user can override on the make command line.CTANGLEFLAGS_DEFAULT=-bhp AC_SUBST(CTANGLEFLAGS_DEFAULT)CWEAVEFLAGS_DEFAULT=-bhp AC_SUBST(CWEAVEFLAGS_DEFAULT)if test -z "$CTANGLE"; then CTANGLE_CMD='@echo "Sorry, ctangle is not installed, so I cannot make $@ from $<" 1>&2; exit 1;';dnl PIZZATANGLE_CMD=$CTANGLE_CMDdnl JAVATANGLE_CMD=$CTANGLE_CMDelse # -bhp turns off the banner, happy and progress messages. # We use $*.w instead of $< because we might use this command line to # make something with a .ch file as the dependency. CTANGLE_CMD='if test -f $(srcdir)/$*.ch; then \\\ $(CTANGLE) $(CTANGLEFLAGS_DEFAULT) $(CTANGLEFLAGS) $(srcdir)/$*.w $(srcdir)/$*.ch; \\\ else \\\ $(CTANGLE) $(CTANGLEFLAGS_DEFAULT) $(CTANGLEFLAGS) $(srcdir)/$*.w; \\\ fi';dnl PIZZATANGLE_CMD='if test -f $(srcdir)/$*.ch; then \\\dnl $(CTANGLE) $(CTANGLEFLAGS_DEFAULT) $(CTANGLEFLAGS) $(srcdir)/$*.pw $(srcdir)/$*.ch; \\\dnl else \\\dnl $(CTANGLE) $(CTANGLEFLAGS_DEFAULT) $(CTANGLEFLAGS) $<; \\\dnl fi';dnl JAVATANGLE_CMD='if test -f $(srcdir)/$*.ch; then \\\dnl $(CTANGLE) $(CTANGLEFLAGS_DEFAULT) $(CTANGLEFLAGS) $(srcdir)/$*.jw $(srcdir)/$*.ch; \\\dnl else \\\dnl $(CTANGLE) $(CTANGLEFLAGS_DEFAULT) $(CTANGLEFLAGS) $<; \\\dnl fi';fiif test -z "$CWEAVE"; then CWEAVE_CMD='@echo "Sorry, cweave is not installed, so I cannot make $@ from $<" 1>&2; exit 1;';dnl PIZZAWEAVE_CMD=$CWEAVE_CMDdnl JAVAWEAVE_CMD=$CWEAVE_CMDelse # -bhp turns off the banner, happy and progress messages. CWEAVE_CMD='if test -f $(srcdir)/$*.ch; then \\\ $(CWEAVE) $(CWEAVEFLAGS_DEFAULT) $(CWEAVEFLAGS) $(srcdir)/$*.w $(srcdir)/$*.ch; \\\ else \\\ $(CWEAVE) $(CWEAVEFLAGS_DEFAULT) $(CWEAVEFLAGS) $<; \\\ fi';dnl PIZZAWEAVE_CMD='if test -f $(srcdir)/$*.ch; then \\\dnl $(CWEAVE) $(CWEAVEFLAGS_DEFAULT) $(CWEAVEFLAGS) $(srcdir)/$*.pw $(srcdir)/$*.ch; \\\dnl else \\\dnl $(CWEAVE) $(CWEAVEFLAGS_DEFAULT) $(CWEAVEFLAGS) $<; \\\dnl fi';dnl JAVAWEAVE_CMD='if test -f $(srcdir)/$*.ch; then \\\dnl $(CWEAVE) $(CWEAVEFLAGS_DEFAULT) $(CWEAVEFLAGS) $(srcdir)/$*.jw $(srcdir)/$*.ch; \\\dnl else \\\dnl $(CWEAVE) $(CWEAVEFLAGS_DEFAULT) $(CWEAVEFLAGS) $<; \\\dnl fi';fiif test -z "$TEX"; then TEX_CMD='@echo "Sorry, TeX is not installed, so I cannot make $@ from $<" 1>&2; exit 1;';else TEX_CMD='$(TEX) $(TEXFLAGS) $<;';fiif test -z "$LATEX"; then LATEX_CMD='@echo "Sorry, LaTeX is not installed, so I cannot make $@ from $<" 1>&2; exit 1;';else LATEX_CMD='$(LATEX) $(LATEXFLAGS) $<;';fiif test -z "$DVIPS"; then DVIPS_CMD='@echo "Sorry, LaTeX is not installed, so I cannot make $@ from $<" 1>&2; exit 1;';else DVIPS_CMD='$(DVIPS) $(DVIPSFLAGS) $< -o $@;';fiif test -z "$MP"; then MP_CMD='@echo "Sorry, MetaPost is not installed, so I cannot make $@ from $<" 1>&2; exit 1;';else MP_CMD='$(MP) $(MPFLAGS) $< \\bye;';fiAC_SUBST(CTANGLE_CMD)dnl AC_SUBST(PIZZATANGLE_CMD)dnl AC_SUBST(JAVATANGLE_CMD)AC_SUBST(CWEAVE_CMD)dnl AC_SUBST(PIZZAWEAVE_CMD)dnl AC_SUBST(JAVAWEAVE_CMD)AC_SUBST(TEX_CMD)AC_SUBST(LATEX_CMD)AC_SUBST(DVIPS_CMD)AC_SUBST(MP_CMD)dnl The tsp instance generators in the tspgen directory are written indnl literate Pizza. They need the CWEB suite to be built from sources.dnl To be compiled, they need a Pizza compiler, which I call pizzac,dnl a non-standard name; I think the Pizza web sites suggest dnl pc as the pizza compiler name.dnl AC_PATH_PROG(PIZZAC,pizzac)dnl if test -z "$PIZZAC"; thendnl echo yeahdnl PIZZAC_CMD='@echo "Sorry, a Pizza compiler is not installed as pizzac, so I cannot make $@ from $<" 1>&2; exit 1;';dnl elsednl PIZZAC_CMD='$(PIZZAC) $(PIZZACFLAGS) $<;';dnl fidnl AC_SUBST(PIZZAC_CMD)dnl AC_PATH_PROG(JAVAC,javac)dnl if test -z "$JAVAC"; thendnl JAVAC_CMD='@echo "Sorry, a Java compiler is not installed as javac, so I cannot make $@ from $<" 1>&2; exit 1;';dnl elsednl JAVAC_CMD='$(JAVAC) $(JAVACFLAGS) $<;';dnl fidnl AC_SUBST(JAVAC_CMD)dnl Checks for libraries ##############################dnl `sqrt' is an arbitrary function in the math library, -lmAC_CHECK_LIB(m, sqrt)dnl Solaris 2.4 is strange because it puts getrusage and other BSD functionsdnl in -lucb.dnl The user might have to have /usr/ucblib in their LD_LIBRARY_PATH.dnl What about other systems?AC_CHECK_LIB(ucb, getrusage)dnl Checks for header files ###########################AC_HEADER_STDCAC_CHECK_HEADERS(limits.h sys/time.h unistd.h time.h)dnl Header files on Solaris and IRIX are missing some prototypes.dnl We provide prototypes for standard things only.OS_IS_SUNOS=0; OS_HAS_BROKEN_HEADERS=0;case $host_os in solaris* | sunos* ) OS_HAS_BROKEN_HEADERS=1 OS_IS_SUNOS=1 ;; irix*) OS_HAS_BROKEN_HEADERS=1 ;;esacAC_DEFINE_UNQUOTED(OS_HAS_BROKEN_HEADERS,$OS_HAS_BROKEN_HEADERS)dnl We have to jump through hoops to properly get `[' and `]' becausednl Autoconf does some funny substitutions, destryoing my sed expression.dnl At one point I used echo -e to define lbr and rbr, but that doesn'tdnl work on Solaris 2.4.lbr=`echo ' ' | tr ' ' '\133'`rbr=`echo ' ' | tr ' ' '\135'`OS_VERSION_MAJOR=`uname -r | sed -e 's/\('$lbr'0-9'$rbr'*\)\..*/\1/'`OS_VERSION_MINOR=`uname -r | sed -e 's/'$lbr'0-9'$rbr'*\.\('$lbr'0-9'$rbr'*\).*/\1/'`dnl echo host is $host_cpu $host_vendor $host_os dnl echo OS_VERSION_MAJOR is $OS_VERSION_MAJORdnl echo OS_VERSION_MINOR is $OS_VERSION_MINORAC_DEFINE_UNQUOTED(OS_IS_SUNOS,$OS_IS_SUNOS)AC_DEFINE_UNQUOTED(OS_VERSION_MAJOR,$OS_VERSION_MAJOR)AC_DEFINE_UNQUOTED(OS_VERSION_MINOR,$OS_VERSION_MINOR)dnl Checks for typedefs ###############################AC_TYPE_SIZE_Tdnl Checks for structures #############################dnl struct rusagednl Checks for compiler characteristics ###############AC_C_CONSTAC_C_INLINEcase "$ac_cv_c_inline" in no) AC_DEFINE(COMPILER_SUPPORTS_INLINE,0) ;; *) AC_DEFINE(COMPILER_SUPPORTS_INLINE,1) ;;esacAC_C_LONG_DOUBLEdnl Do the most significant bytes come first in a word?AC_C_BIGENDIANdnl Find sizes of variables of various sizesAC_CHECK_SIZEOF(short)AC_CHECK_SIZEOF(int)AC_CHECK_SIZEOF(unsigned int)AC_CHECK_SIZEOF(long)AC_CHECK_SIZEOF(long long)dnl Checks for library functions ######################AC_FUNC_VPRINTFAC_CHECK_FUNCS(getrusage getpagesize gethostname strdup time ctime getopt nrand48)dnl See if the library defines optarg, optind, opterr, and optopt, all requireddnl by getoptAC_TRY_LINK([ #if HAVE_UNISTD_H #define _POSIX_C_SOURCE 2 #include <unistd.h> #endif #include <stdlib.h> ],[{extern char *optarg; extern int optind, opterr, optopt;}], AC_DEFINE_UNQUOTED(LIBRARY_DEFINES_OPTARG_ETC,1), AC_DEFINE_UNQUOTED(LIBRARY_DEFINES_OPTARG_ETC,0))dnl Now see if the headers also *declare* those functions.AC_TRY_LINK([ #if HAVE_UNISTD_H #define _POSIX_C_SOURCE 2 #include <unistd.h> #endif #include <stdlib.h> ],[{char *foo = optarg;}], AC_DEFINE_UNQUOTED(HEADERS_DECLARE_OPTARG_ETC,1), AC_DEFINE_UNQUOTED(HEADERS_DECLARE_OPTARG_ETC,0))dnl Checks system services ############################dnl Epilogue ##########################################dnl The "test" for generating stamp-h is needed by Automake when usingdnl macro AC_CONFIGURE_HEADER.AC_OUTPUT([\Makefile \gen.pl \genhk.pl \doitall \src/Makefile \src/compile.c \dnl tspgen/Makefile \dnl tspgen/pizzaw2pizza \dnl doc/Makefile \data/Makefile \expt/Makefile \script/Makefile \script/att2upper.pl \script/cd.pl \script/cfresults.pl \script/countpages.pl \script/distcalc.pl \script/domst.pl \script/doshake.pl \script/doshakelk.pl \script/expt.pl \script/GB_flip.pm \script/hist.pl \script/improve.pl \script/least.pl \script/lkdoit \script/lkdoitcmp \script/milestone.pl \script/mkcwebch.pl \script/mkmountain.pl \script/mktable.pl \script/mstelratio.pl \script/mstrsortlen.pl \script/mstsortlen.pl \script/myps2eps.pl \script/number.pl \script/PRNG.pm \script/probe.pl \script/results.pl \script/spectrum.pl \script/TSP.pm \script/tsp2dm.pl \script/tspbgen.pl \script/tspreorder.pl \script/tsprotate.pl \script/tsplib2rothberg.pl \], [test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h])
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -