configure.ac

来自「Linux/Unix下的绘图函数库(Graphic Drawing Librar」· AC 代码 · 共 474 行 · 第 1/2 页

AC
474
字号
        LIBS="$save_LIBS"        CFLAGS="$save_CFLAGS"        # More AIX lossage: must compile with cc_r        AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})else        PTHREAD_CC="$CC"fiAC_SUBST(PTHREAD_LIBS)AC_SUBST(PTHREAD_CFLAGS)AC_SUBST(PTHREAD_CC)# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:if test x"$acx_pthread_ok" = xyes; then        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])        :else        acx_pthread_ok=no        $2fiAC_LANG_RESTORE])dnl ACX_PTHREADdnl do we need to specify -lm explicitly?AC_CHECK_FUNC(sin,,[AC_CHECK_LIB(m,sin)])dnl zlib is requiredAC_CHECK_LIB(z,deflate,  [LIBS="-lz $LIBS"   AC_DEFINE(HAVE_LIBZ, 1, [ Define if you have zlib. ])],  [AC_MSG_WARN([zlib is required - see http://www.gzip.org/zlib/])])dnl libpng is requiredAC_ARG_WITH(png,dnl[  --with-png=DIR          where to find the png library],,  withval=yes)# libpng12.so is a nightmare. We have to test separately for# libpng12-config and libpng-config. If we find libpng12-config,# we don't look for the other, which will just be a symlink to it,# confusing autoconf into thinking the library itself will be named -lpng,# which it won't be. Awful. This code will suffice unless the libpng# authors decide to do this AGAIN. Which I really hope they won't. TBBif test "$withval" != no; then  AC_PATH_PROG([LIBPNG12_CONFIG], [libpng12-config])  AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])  if test -n "$LIBPNG12_CONFIG"; then    libpng_CPPFLAGS=`libpng12-config --cflags`    # should be --ldopts, but it's currently broken    libpng_LDFLAGS=`libpng12-config --ldflags`    libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`  elif test -n "$LIBPNG_CONFIG"; then    libpng_CPPFLAGS=`libpng-config --cflags`    # should be --ldopts, but it's currently broken    libpng_LDFLAGS=`libpng-config --ldflags`    libpng_LDFLAGS=`echo " $libpng_LDFLAGS" | sed 's/ -l[[^ ]][[^ ]]*//g'`  elif test -d "$withval"; then    libpng_CPPFLAGS="-I$withval/include"    libpng_LDFLAGS="-L$withval/lib"  fi  AC_CHECK_HEADERS(png.h,,    [AC_CHECK_HEADERS(libpng/png.h,       [CPPFLAGS="$CPPFLAGS $libpng_CPPFLAGS/libpng"],       [CPPFLAGS="$_cppflags"])])  _ldflags="$LDFLAGS"  LDFLAGS="$libpng_LDFLAGS $LDFLAGS"  if test -n "$LIBPNG12_CONFIG"; then    AC_CHECK_LIB(png12,png_create_read_struct,      [LIBS="-lpng12 $LIBS"       FEATURES="GD_PNG $FEATURES"       AC_DEFINE(HAVE_LIBPNG, 1, [ Define if you have the png library. ])],      [LDFLAGS="$_ldflags"         AC_MSG_WARN([libpng is required - see http://www.libpng.org/pub/png/])])  elif test -n "$LIBPNG_CONFIG"; then    AC_CHECK_LIB(png,png_create_read_struct,      [LIBS="-lpng $LIBS"        FEATURES="GD_PNG $FEATURES"       AC_DEFINE(HAVE_LIBPNG, 1, [ Define if you have the png library. ])],      [LDFLAGS="$_ldflags"         AC_MSG_WARN([libpng is required - see http://www.libpng.org/pub/png/])])  else    AC_CHECK_LIB(png,png_create_read_struct,      [LIBS="-lpng $LIBS"        FEATURES="GD_PNG $FEATURES"       AC_DEFINE(HAVE_LIBPNG, 1, [ Define if you have the png library. ])],      [LDFLAGS="$_ldflags"         AC_MSG_WARN([libpng is required - see http://www.libpng.org/pub/png/])])  fielse  ac_cv_lib_png_png_create_read_struct=no  AC_MSG_WARN([libpng is required - see http://www.libpng.org/pub/png/])fi#TBB: png12's png_create_read_struct is just as good #2.0.23: should be = not ==  if test "$ac_cv_lib_png12_png_create_read_struct" = yes; then  ac_cv_lib_png_png_create_read_struct=yesfi dnl FreeType configure tests snarfed from libwmf ..AC_ARG_WITH(freetype,dnl[  --with-freetype=DIR     where to find the freetype 2.x library],  [if test "$withval" != no; then     if test "$withval" != yes; then       FREETYPE_DIR=$withval     fi   fi])if test "$withval" != no; then  if test -n "$FREETYPE_DIR"; then    AC_PATH_PROG(FREETYPE_CONFIG,freetype-config,,[$FREETYPE_DIR/bin:$PATH])  else    AC_PATH_PROG(FREETYPE_CONFIG,freetype-config)  fi  if test -n "$FREETYPE_CONFIG"; then    if test -n "$FREETYPE_DIR"; then      libft_INCLUDES="`$FREETYPE_CONFIG --cflags` -I$FREETYPE_DIR/include"    else      libft_INCLUDES=`$FREETYPE_CONFIG --cflags`    fi    libft_LDFLAGS=`$FREETYPE_CONFIG --libs`    libft_LDFLAGS=`echo " $libft_LDFLAGS" |sed 's/ -l[[^ ]][[^ ]]*//g'`  else    if test -n "$FREETYPE_DIR"; then      libft_INCLUDES="-I$FREETYPE_DIR/include/freetype2 -I$FREETYPE_DIR/include"      libft_LDFLAGS="-L$FREETYPE_DIR/lib"    else      libft_INCLUDES=""      libft_LDFLAGS=""    fi  fi  _cppflags="$CPPFLAGS"  _ldflags="$LDFLAGS"  CPPFLAGS="$libft_INCLUDES $CPPFLAGS"  LDFLAGS="$libft_LDFLAGS $LDFLAGS"  SAVE_FEATURES=$FEATURES  AC_CHECK_LIB(freetype,FT_Init_FreeType,    [LIBS="-lfreetype $LIBS"      FEATURES="GD_FREETYPE $FEATURES"     AC_DEFINE(HAVE_LIBFREETYPE, 1, [ Define if you have the freetype library. ])],    [LDFLAGS="$_ldflags"     AC_MSG_WARN([not found - disabling freetype support])     FEATURES=$SAVE_FEATURES])  #TBB: 2.0.26: newer gd versions require ft2build.h  AC_CHECK_HEADERS(ft2build.h,,      [AC_MSG_RESULT([no])      FEATURES=$SAVE_FEATURES      ac_cv_lib_freetype_FT_Init_FreeType=no      CPPFLAGS="$_cppflags"])else  ac_cv_lib_freetype_FT_Init_FreeType=nofidnl check for libfontconfig by defaultAC_ARG_WITH(fontconfig,dnl[  --with-fontconfig=DIR         where to find the fontconfig library],  [if test -d "$withval"; then     LDFLAGS="$LDFLAGS -L$withval/lib"     CPPFLAGS="$CPPFLAGS -I$withval/include"   fi],  withval=yes)if test "$withval" != no; then  AC_CHECK_LIB(fontconfig,FcInit,    [LIBS="-lfontconfig $LIBS"      FEATURES="GD_FONTCONFIG $FEATURES"     AC_DEFINE(HAVE_LIBFONTCONFIG, 1, [ Define if you have the fontconfig library. ])])else  ac_cv_lib_fontconfig_FcInit=nofidnl check for libjpeg by defaultAC_ARG_WITH(jpeg,dnl[  --with-jpeg=DIR         where to find the jpeg library],  [if test -d "$withval"; then     LDFLAGS="$LDFLAGS -L$withval/lib"     CPPFLAGS="$CPPFLAGS -I$withval/include"   fi],  withval=yes)if test "$withval" != no; then  AC_CHECK_LIB(jpeg,jpeg_set_defaults,    [LIBS="-ljpeg $LIBS"      FEATURES="GD_JPEG $FEATURES"     AC_DEFINE(HAVE_LIBJPEG, 1, [ Define if you have the jpeg library. ])])else  ac_cv_lib_jpeg_jpeg_set_defaults=nofidnl check for libXpm by defaultAC_ARG_WITH(xpm,dnl[  --with-xpm=DIR          where to find the xpm library],  [if test -d "$withval"; then     LDFLAGS="$LDFLAGS -L$withval/lib"     CPPFLAGS="$CPPFLAGS -I$withval/include"   fi],  withval=yes)if test "$withval" != no; then  AC_CHECK_LIB(Xpm,XpmReadFileToXpmImage,    [LIBS="-lXpm -lX11 $LIBS"     FEATURES="GD_XPM $FEATURES"     AC_DEFINE(HAVE_LIBXPM, 1, [ Define if you have the Xpm library. ])],,    [-lX11])else  ac_cv_lib_Xpm_XpmReadFileToXpmImage=nofiACX_PTHREAD()dnl report configurationAC_MSG_RESULT([** Configuration summary for $PACKAGE $VERSION:   Support for PNG library:          $ac_cv_lib_png_png_create_read_struct   Support for JPEG library:         $ac_cv_lib_jpeg_jpeg_set_defaults   Support for Freetype 2.x library: $ac_cv_lib_freetype_FT_Init_FreeType   Support for Fontconfig library:   $ac_cv_lib_fontconfig_FcInit   Support for Xpm library:          $ac_cv_lib_Xpm_XpmReadFileToXpmImage   Support for pthreads:             $acx_pthread_ok])AC_CONFIG_FILES([Makefile config/Makefile config/gdlib-config test/Makefile])AC_OUTPUT

⌨️ 快捷键说明

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