diff --git a/autogen.sh b/autogen.sh index dab8e09..8fe40c2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -4,5 +4,5 @@ aclocal autoheader autoconf automake --add-missing - +./configure diff --git a/configure.ac b/configure.ac index 6a118d0..c4ba72b 100644 --- a/configure.ac +++ b/configure.ac @@ -15,12 +15,12 @@ AC_PROG_CC AM_PROG_CC_STDC AC_HEADER_STDC AC_C_INLINE + AC_FUNC_VPRINTF AC_CHECK_FUNCS(vsnprintf) dnl Checks for programs. - dnl Checks for libraries. dnl Check for SDL AM_PATH_SDL(1.1.0, @@ -28,13 +28,12 @@ dnl Check for SDL AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix) ) - CFLAGS="$SDL_CFLAGS $CFLAGS" + CFLAGS="$SDL_CFLAGS $CFLAGS -I../include" SDL_LIBS="$SDL_LIBS -lpng -ljpeg" LIBS="$SDL_LIBS $LIBS" dnl Checks for header files. - dnl Checks for typedefs, structures, and compiler characteristics. case "$target" in *cygwin* | *mingw32* | *mingw32msvc* ) @@ -63,26 +62,7 @@ case "$target" in ;; esac - -dnl Debug ************************************ -AC_ARG_ENABLE(debug, [ --disable-debug Disable Debuging ]) -if test x$enable_debug = xno ; then - CFLAGS="$CFLAGS" -else - CFLAGS="$CFLAGS -ggdb -O0" - LDFLAGS="$LDFLAGS -ggdb" - AC_MSG_WARN(Enable Debuging) -fi - -dnl All Warning are Errors ************************ -AC_ARG_ENABLE(werror, [ --disable-werror Disable Warning as Error Treatment ]) -if test x$enable_werror = xno ; then - CFLAGS="$CFLAGS -Wall" - AC_MSG_WARN(Disable Warning as Error Treatment) -else - CFLAGS="$CFLAGS -Wall -Werror" -fi - +AC_CHECK_LIB([m],[cos]) dnl SDL_image library ***************************** AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, , AC_MSG_ERROR([ @@ -115,8 +95,6 @@ else fi fi - - dnl Checks for library functions. dnl Check for rintf and functions like that AC_MSG_CHECKING(for rintf) @@ -124,20 +102,13 @@ have_rintf=no AC_TRY_COMPILE([ #include ],[ -int i; float f; i = rintf (f); +int i; float f = 0.0; i = rintf (f); i++; ],[ have_rintf=yes ]) AC_MSG_RESULT($have_rintf) -if test x$have_rintf = xno; then -dnl AC_CHECK_LIB([m],[cos]) - AC_CHECK_LIB(m, rintf, have_rintf=yes, have_rintf=no , ) -fi - if test x$have_rintf = xyes; then AC_DEFINE(HAVE_RINTF, [1], [if rintf is working here]) -else - AC_MSG_WARN([*** something wrong with libm????? ]) fi @@ -148,14 +119,11 @@ have_rint=no AC_TRY_COMPILE([ #include ],[ -int i; double f; i = rint (f); +int i; double f = 0.0; i = rint (f); i++; ],[ have_rint=yes ]) AC_MSG_RESULT($have_rint) -if test x$have_rint = xno; then - AC_CHECK_LIB(m, rint, have_rint=yes, have_rint=no , ) -fi if test x$have_rint = xyes; then AC_DEFINE(HAVE_RINT, [1], [if rint is working here]) @@ -169,14 +137,11 @@ have_powf=no AC_TRY_COMPILE([ #include ],[ -float i; float f = 2; float j = 2; i = powf (f,j); +float i; float f = 2.0; float j = 2.0; i = powf (f,j); i = i + 1.0; ],[ have_powf=yes ]) AC_MSG_RESULT($have_powf) -if test x$have_powf = xno; then - AC_CHECK_LIB(m, powf, have_powf=yes, have_powf=no , ) -fi if test x$have_powf = xyes; then AC_DEFINE(HAVE_POWF, [1], [if powf is working here]) @@ -188,14 +153,11 @@ have_sqrtf=no AC_TRY_COMPILE([ #include ],[ -float i; float f = 2; i = sqrtf (f); +float i; float f = 2.0; i = sqrtf (f); i = i + 1.0; ],[ have_sqrtf=yes ]) AC_MSG_RESULT($have_sqrtf) -if test x$have_sqrtf = xno; then - AC_CHECK_LIB(m, sqrtf, have_sqrtf=yes, have_sqrtf=no , ) -fi if test x$have_sqrtf = xyes; then AC_DEFINE(HAVE_SQRTF, [1], [if sqrtf is working here]) @@ -208,21 +170,37 @@ have_floorf=no AC_TRY_COMPILE([ #include ],[ -int i; float f; i = floorf (f); +int i = 0; float f = 1.0; i = i + floorf (f); ],[ have_floorf=yes ]) AC_MSG_RESULT($have_floorf) -if test x$have_floorf = xno; then - AC_CHECK_LIB(m, floorf, have_floorf=yes, have_floorf=no , ) -fi + if test x$have_floorf = xyes; then AC_DEFINE(HAVE_FLOORF, [1], [if floorf is working here]) fi + dnl Checks for Additional stuffs. +dnl Debug ************************************ +AC_ARG_ENABLE(debug, [ --disable-debug Disable Debuging ]) +if test x$enable_debug = xno ; then + CFLAGS="$CFLAGS" +else + CFLAGS="$CFLAGS -ggdb -O0" + LDFLAGS="$LDFLAGS -ggdb" + AC_MSG_WARN(Enable Debuging) +fi +dnl All Warning are Errors ************************ +AC_ARG_ENABLE(werror, [ --disable-werror Disable Warning as Error Treatment ]) +if test x$enable_werror = xno ; then + CFLAGS="$CFLAGS -Wall" + AC_MSG_WARN(Disable Warning as Error Treatment) +else + CFLAGS="$CFLAGS -Wall -Werror" +fi dnl Set PACKAGE SOURCE DIR in config.h.