# Process this file with autoconf to produce a configure script. # # autoconf setup # AC_PREREQ(2.53) AC_INIT([yasm], m4_esyscmd([./YASM-VERSION-GEN.sh && tr -d '\n' #ifdef __GNU_LIBRARY__ gnulib #endif ], yasm_cv_header_gnulib=yes, yasm_cv_header_gnulib=no)) if test "$yasm_cv_header_gnulib" = yes; then AC_DEFINE([HAVE_GNU_C_LIBRARY]) fi # Force x86 architecture only for now. ARCH=x86 AC_SUBST([ARCH]) AC_SUBST([GCC]) # Require things for --enable-maintainer-mode option. if test "$USE_MAINTAINER_MODE" = "yes"; then # Enable debugging if test "$debugging" != "no"; then debugging=yes fi # Enable more warnings if test "$GCC" = "yes"; then MORE_CFLAGS="$MORE_CFLAGS -W" MORE_CFLAGS="$MORE_CFLAGS -Waggregate-return" MORE_CFLAGS="$MORE_CFLAGS -Wbad-function-cast" MORE_CFLAGS="$MORE_CFLAGS -Wcast-align" MORE_CFLAGS="$MORE_CFLAGS -Wcast-qual" MORE_CFLAGS="$MORE_CFLAGS -Wchar-subscripts" # MORE_CFLAGS="$MORE_CFLAGS -Wconversion" # MORE_CFLAGS="$MORE_CFLAGS -Wdeclaration-after-statement" # MORE_CFLAGS="$MORE_CFLAGS -Wendif-labels" MORE_CFLAGS="$MORE_CFLAGS -Winline" MORE_CFLAGS="$MORE_CFLAGS -Wmissing-declarations" MORE_CFLAGS="$MORE_CFLAGS -Wmissing-prototypes" MORE_CFLAGS="$MORE_CFLAGS -Wnested-externs" MORE_CFLAGS="$MORE_CFLAGS -Wpointer-arith" MORE_CFLAGS="$MORE_CFLAGS -Wreturn-type" MORE_CFLAGS="$MORE_CFLAGS -Wshadow" MORE_CFLAGS="$MORE_CFLAGS -Wsign-compare" MORE_CFLAGS="$MORE_CFLAGS -Wstrict-prototypes" MORE_CFLAGS="$MORE_CFLAGS -Wswitch" MORE_CFLAGS="$MORE_CFLAGS -Wwrite-strings" MORE_CFLAGS="$MORE_CFLAGS -Wno-undef" # MORE_CFLAGS="$MORE_CFLAGS -Wno-unused" MORE_CFLAGS="$MORE_CFLAGS -Wno-unused-parameter" fi fi # # Add some more CFLAGS for various options. # if test "$debugging" = "no" ; then changequote(,) CFLAGS="`echo $CFLAGS' ' | sed -e 's/-g[0-9] //g' | sed -e 's/-g//g'`" changequote([,]) fi # Turn warnings into errors if test "$warnerror" = "yes"; then if test "$GCC" = "yes"; then MORE_CFLAGS="$MORE_CFLAGS -Werror" fi fi # Enable output of profiling information if test "$profiling" = "yes"; then if test "$GCC" = "yes"; then MORE_CFLAGS="$MORE_CFLAGS -pg" fi fi # Enable output of gcov information if test "$gcov" = "yes"; then if test "$GCC" = "yes"; then MORE_CFLAGS="$MORE_CFLAGS -fprofile-arcs -ftest-coverage" fi fi # If we're using GCC, then we can turn on -ansi -pedantic -Wall too. if test "$USE_MAINTAINER_MODE" = "yes"; then if test "$GCC" = yes; then MORE_CFLAGS="-ansi -pedantic -Wall $MORE_CFLAGS" fi fi AC_SUBST(MORE_CFLAGS) AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler]) AC_ARG_VAR(CCLD_FOR_BUILD,[build system C linker frontend]) if test "${build}" != "${host}" ; then CC_FOR_BUILD=${CC_FOR_BUILD-cc} CCLD_FOR_BUILD=${CCLD_FOR_BUILD-cc} else CC_FOR_BUILD="\$(CC)" CCLD_FOR_BUILD="\$(CC)" fi AC_SUBST(CC_FOR_BUILD) AC_SUBST(CCLD_FOR_BUILD) AC_ARG_VAR(CPP_FOR_HOST,[host system C preprocessor]) if test "$build" != "$target" || test "$build" != "$host"; then CPP_PROG="${CPP_FOR_HOST-cc -E}" else CPP_PROG="${CPP}" fi AC_DEFINE_UNQUOTED([CPP_PROG], "${CPP_PROG}", [Command name to run C preprocessor]) # Detect if we have Python if test x$enable_python = xno; then have_python=no else AC_MSG_NOTICE([Checking for Python]) have_python=no AM_PATH_PYTHON(2.4,[],[AC_MSG_WARN([Python not found])]) if test -z "$PYTHON" || test "$PYTHON" = : ; then have_python=no else have_python=yes fi if test x$have_python = xno ; then if test x$enable_python = xyes ; then AC_MSG_ERROR([Python explicitly requested, but a suitable Python version was not found]) else AC_MSG_WARN([Could not find a suitable version of Python]) fi fi fi # Detect if we can build Python bindings # (needs Python, Python headers, and Cython) if test x$enable_python_bindings = xno; then have_python_bindings=no else AC_MSG_NOTICE([Checking to see if we can build Python bindings]) have_python_bindings=no if test x$have_python = xyes; then AC_MSG_CHECKING([for Cython >= 0.11.3]) CYTHON_CHECK_VERSION(0.11.3, [AC_MSG_RESULT(yes) have_cython=yes], [AC_MSG_RESULT(no) have_cython=no]) AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no) if test x$have_cython = xyes -a x$have_python_headers = xyes ; then have_python_bindings=yes fi fi if test x$have_python_bindings = xno ; then if test x$enable_python_bindings = xyes ; then AC_MSG_ERROR([Building Python bindings explicitly requested, but can't build Python bindings because either Cython, Python headers or a suitable Python version was not found]) else AC_MSG_WARN([Couldn't find either Cython, the Python headers or a suitable version of Python, not building Python bindings]) fi fi fi AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes) AM_CONDITIONAL(HAVE_PYTHON_BINDINGS, test x$have_python_bindings = xyes) AC_CONFIG_FILES([Makefile po/Makefile.in ]) AC_OUTPUT