📄 configure.in
字号:
dnl Process this file with autoconf to produce a configure script.AC_INIT(wrapper.c)AC_CONFIG_HEADER(config.h)AC_CONFIG_AUX_DIR(.)AC_PROG_INSTALLdnl "Declare" variables that will be substituted in the output filesdnl and that the user might want to override at configure timeAC_SUBST(OPTIMIZE)AC_SUBST(EXTRA_CFLAGS)AC_SUBST(INCLUDE_DIRS)AC_SUBST(DEFINES)AC_SUBST(EXTRA_LDFLAGS)# Warn if user set CFLAGS, CPPFLAGS, or LDFLAGS (we override them)if test -s "$CFLAGS" ; then AC_MSG_WARN(value of CFLAGS ignored--set OPTIMIZE and/or EXTRA_CFLAGS instead) ; fiif test -s "$CPPFLAGS" ; then AC_MSG_WARN(value of CPPFLAGS ignored--set INCLUDE_DIRS and/or DEFINES instead) ; fiif test -s "$LDFLAGS" ; then AC_MSG_WARN(value of LDFLAGS ignored--set EXTRA_LDFLAGS instead) ; fi# Get host architecture (really only interested in OS)AC_CANONICAL_HOST# And determine endian-ness (needed if we have to define our own# htonl() function on platforms that lack netinet/in.h)AC_C_BIGENDIAN# Determine the standalone executables to build -- mpegtest on all# platforms, plus easympeg on IRIX. (This assumes that IRIX means# SGI, and SGI means GL -- and vice-versa. Should work until # I make easympeg work with OpenGL!)extras="mpegtest"case "$host_os" in irix*) extras="$extras easympeg" ;;esacAC_SUBST(extras)# Set the default compiler optimization flags (only if nothing # supplied from the environment)if test -z "$OPTIMIZE" ; then OPTIMIZE="-O2" ; fi# Set CFLAGS and CPPFLAGS here in preparation for testing the # compiler. (Note that the values set here are *not* exported# to the output files; we let the Makefiles take care of putting# these values together again. That way the user can override eg.# OPTIMIZE at build-time as well as at configure time.)CFLAGS="$OPTIMIZE $EXTRA_CFLAGS"CPPFLAGS="$INCLUDE_DIRS $DEFINES"# Look for the C compiler (default gcc), and make sure it supports# prototypes, void, and enums properly (can't trust __STDC__).AC_PROG_CCcc_flagged=`echo "$CC $CFLAGS" |sed 's/ +/ /;s/ *$//'`AC_MSG_CHECKING(that \"$cc_flagged\" is fairly ANSI-compliant)AC_CACHE_VAL(mpeg_cv_cc_ansi, [AC_TRY_COMPILE(, [typedef enum { RED, GREEN, BLUE, YELLOW, BLACK } colour;void *foo (colour C);colour a = GREEN;foo (a);], mpeg_cv_cc_ansi=yes, mpeg_cv_cc_ansi=no)])CC_ANSI=$mpeg_cv_cc_ansiAC_MSG_RESULT($CC_ANSI)if test $CC_ANSI = no; then AC_MSG_CHECKING(for alternative C compiler) AC_CHECK_PROGS(ALTCC, acc, none) if test $ALTCC = none; then AC_MSG_ERROR(An ANSI-compliant C compiler is required to build the MPEG Library) else CC=$ALTCC fifi# Process the "--with-dmalloc" optionAC_ARG_WITH(dmalloc, [ --with-dmalloc use the dmalloc library])if test "$with_dmalloc" = "yes" ; then DEFINES="$DEFINES -DDMALLOC" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldmalloc"fi# Look for ranlib and arAC_PROG_RANLIBAC_CHECK_PROG(AR, ar, ar)# Check for the "--disable-dither" option: this controls which files will# actually be compiled and included in the library, so has to be processed# at configure time. Also, enable/disable dither controls the# ENABLE_DITHER #define, which is done through config.h.AC_ARG_ENABLE(dither,[ --enable-dither include code for all dithering modes (default) --disable-dither only include code for full-colour conversion (useful when linking with ImageMagick)],dither=$enable_dither, dither=yes)if test $dither = yes; then libsrc='$(DECODER_SRC) $(DITHER_SRC)' libobj='$(DECODER_SRC:.c=.o) $(DITHER_SRC:.c=.o)' AC_DEFINE(ENABLE_DITHER, 1) AC_MSG_RESULT(including dithering code)else libsrc='$(DECODER_SRC)' libobj='$(DECODER_SRC:.c=.o)' AC_DEFINE(ENABLE_DITHER, 0) AC_MSG_RESULT(omitting dithering code)fiAC_SUBST(libsrc)AC_SUBST(libobj)# Check for header filesAC_HEADER_STDCAC_CHECK_HEADERS(sys/time.h unistd.h netinet/in.h)# Check for typedefs, structures, and compiler characteristicsAC_HEADER_TIME# Check for library functionsAC_FUNC_VPRINTFAC_CHECK_FUNCS(strtod strtol random rand lrand48)AC_CHECK_FUNC(getrusage,AC_DEFINE(HAVE_GETRUSAGE,1),AC_DEFINE(HAVE_GETRUSAGE,0))# See if random() and lrand48() are actually declared where they're# supposed to be (this is just paranoia-cruft leftover from the# Berkeley code... still necessary?)AC_EGREP_HEADER(random,stdlib.h,AC_DEFINE(HAVE_RANDOM_DECL,1),AC_DEFINE(HAVE_RANDOM_DECL,0))AC_EGREP_HEADER(lrand48,stdlib.h,AC_DEFINE(HAVE_LRAND48_DECL,1),AC_DEFINE(HAVE_LRAND48_DECL,0))# Try to find out where CLK_TCK is defined if we don't have getrusage.# Need to do this because IRIX puts it in <time.h> and <limit.h>, AIX# puts it in <time.h>, SunOS doesn't have it, and I dunno about anyone# else. Note: nothing is currently done with the $clk_tck_where# value; right now I only worry about the case where CLK_TCK isn't# found at all.if test "$ac_cv_func_getrusage" = "no"; then AC_MSG_CHECKING(for where to find CLK_TCK symbol) clk_tck_where="" for hdr in "<time.h>" "<limits.h>" ; do if test -z "$clk_tck_where"; then AC_EGREP_CPP(yes,[#include $hdr #ifdef CLK_TCK yes #endif], clk_tck_where=$hdr) fi done if test -z "$clk_tck_where"; then AC_MSG_WARN([CLK_TCK not found, assuming 60 ticks/sec]) AC_DEFINE(CLK_TCK,60) else AC_MSG_RESULT($clk_tck_where) fifiAC_OUTPUT(Makefile extras/Makefile)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -