X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=configure.ac;h=16b74a39867fbcf6c90e0bd09598fae12d48552b;hb=2f4f40f5c161bda0460145dc79c39082890023a3;hp=e0b811f8681f0ea07f1900dcdeda143b7791702d;hpb=f1a0107068b32e46d2a7eefb90c930483228daeb;p=freeglut diff --git a/configure.ac b/configure.ac index e0b811f..16b74a3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,74 +1,156 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(Makefile.am) +# Process this file with autoconf to produce a configure script. -AM_INIT_AUTOMAKE(freeglut,2.2.0) -AM_CONFIG_HEADER(config.h) +AC_INIT([freeglut library], [3.0.0], [freeglut-bugs@lists.sourceforge.net], [freeglut]) +AM_INIT_AUTOMAKE +AC_PREREQ([2.56]) +AC_CONFIG_SRCDIR([AUTHORS]) +AC_CONFIG_HEADERS([config.h]) -dnl Checks for programs. +# Compatibility hack for older autoconf versions +m4_ifdef([AS_HELP_STRING], [], [AC_DEFUN([AS_HELP_STRING], [AC_HELP_STRING($][@)])]) + +# Checks for programs. AC_PROG_CC +AM_PROG_CC_C_O AC_C_CONST AC_EXEEXT AC_LIBTOOL_DLOPEN -AM_PROG_LIBTOOL -AC_SUBST(LIBTOOL_DEPS) +AC_PROG_LIBTOOL +AC_SUBST([LIBTOOL_DEPS]) -dnl Checks for libraries. +# Checks for libraries. AC_PATH_XTRA -AC_CHECK_LIB(Xxf86vm,XF86VidModeSwitchToMode, - LIBXXF86VM=-lXxf86vm,LIBXXF86VM=,$X_LIBS -lXext -lX11) -AC_SUBST(LIBXXF86VM) - -dnl Checks for header files. -AC_STDC_HEADERS -AC_HAVE_HEADERS( GL/gl.h GL/glu.h GL/glx.h ) +#if test "x$no_x" = xyes; then +# GL_LIBS="-lopengl32 -lgdi32 -lwinmm" +# LIBXXF86VM= +# LIBXI= +# VERSION_INFO= +# EXPORT_FLAGS="-DFREEGLUT_EXPORTS" +#else +# GL_LIBS="-lGL -lXext -lX11" +# AC_CHECK_LIB([Xxf86vm], [XF86VidModeSwitchToMode]) +# AC_CHECK_LIB([Xrandr], [XRRQueryExtension]) +# AC_CHECK_LIB([Xi], [XISelectEvents]) +# LIBXI=-lXi +# VERSION_INFO="-version-info 12:0:9" +# EXPORT_FLAGS= +#fi +VERSION_INFO="-version-info 12:0:9" +AM_CONDITIONAL(TARGET_HOST_MS_WINDOWS, false) +AM_CONDITIONAL(TARGET_HOST_POSIX_X11, false) +AM_CONDITIONAL(TARGET_HOST_ANDROID, false) +case "${host}" in + *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) + # Windows+Cygwin/MSYS, MinGW cross-compilation + GL_LIBS="-lopengl32 -lgdi32 -lwinmm" + LIBXXF86VM= + LIBXI= + CPPFLAGS="$CPPFLAGS -DFREEGLUT_EXPORTS" + AM_CONDITIONAL(TARGET_HOST_MS_WINDOWS, true) + ;; + *-*-linux-androideabi) + # Android + # e.g. arm-unknown-linux-androideabi + GL_LIBS="-lEGL -lGLESv2" + LIBXXF86VM= + LIBXI= + CPPFLAGS="$CPPFLAGS -DANDROID" + AM_CONDITIONAL(TARGET_HOST_ANDROID, true) + ;; + *) + # Unix/X11 + GL_LIBS="-lGL -lXext -lX11" + AC_CHECK_LIB([Xxf86vm], [XF86VidModeSwitchToMode]) + AC_CHECK_LIB([Xrandr], [XRRQueryExtension]) + AC_CHECK_LIB([Xi], [XISelectEvents]) + LIBXI=-lXi + AM_CONDITIONAL(TARGET_HOST_POSIX_X11, true) + ;; +esac -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $X_CFLAGS" -AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,,,[#include ]) -CFLAGS="$save_CFLAGS" +AC_SUBST([GL_LIBS]) +AC_SUBST([LIBXXF86VM]) +AC_SUBST([LIBXI]) +AC_SUBST([VERSION_INFO]) +AC_SUBST([EXPORT_FLAGS]) -dnl Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_LIB([usbhid], [hid_init], + [LIBUSBHID=-lusbhid], [LIBUSBHID=]) +AC_SUBST(LIBUSBHID) -dnl Checks for library functions. +# Checks for header files. +AC_HEADER_STDC +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $X_CFLAGS" +AC_CHECK_HEADERS([usbhid.h libusbhid.h errno.h GL/gl.h GL/glu.h GL/glx.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h]) +AC_HEADER_TIME +AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [], [], [#include ]) +AC_CHECK_HEADERS([X11/extensions/Xrandr.h]) +AC_CHECK_HEADERS([X11/extensions/XI.h X11/extensions/XInput.h]) +AC_CHECK_HEADERS([X11/extensions/XInput2.h]) +CPPFLAGS="$save_CPPFLAGS" +# Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_FUNC_VPRINTF AC_CHECK_LIBM -AC_SUBST(LIBM) +AC_SUBST([LIBM]) +AC_CHECK_FUNCS([gettimeofday]) +AC_CHECK_FUNCS([vfprintf]) -dnl Build time configuration - -AC_ARG_ENABLE(replace-glut, -[ --disable-replace-glut Coexist with existing glut library]) -if test "x$enable_replace_glut" != xno -then - LIBRARY=glut - HEADER=glut.h +# Build time configuration. +AC_ARG_ENABLE([replace-glut], +[AS_HELP_STRING([--enable-replace-glut], + [be a replacement for GLUT @<:@default=yes@:>@])]) +if test "x$enable_replace_glut" != xno; then + LIBRARY=glut + HEADER=glut.h else - LIBRARY=freeglut - HEADER= + LIBRARY=freeglut + HEADER= +fi +AC_SUBST([LIBRARY]) +AC_SUBST([HEADER]) + +AC_ARG_ENABLE([warnings], +[AS_HELP_STRING([--enable-warnings], + [use all gcc compiler warnings @<:@default=yes@:>@])]) +if test "x$enable_warnings" != xno -a "x$GCC" = xyes; then + CFLAGS="$CFLAGS -Wall -pedantic" +fi + +AC_ARG_ENABLE([warnings-as-errors], +[AS_HELP_STRING([--enable-warnings-as-errors], + [make all warnings into errors @<:@default=no@:>@])]) +if test "x$enable_warnings_as_errors" = xyes -a "x$GCC" = xyes; then + CFLAGS="$CFLAGS -Werror" fi -AC_SUBST(LIBRARY) -AC_SUBST(HEADER) -AC_ARG_ENABLE(warnings, -[ --enable-warnings Enable gcc compiler warnings], -if test "x$GCC" == xyes -then - CFLAGS="$CFLAGS -Wall -Wno-parentheses -Werror" -fi) +AC_ARG_ENABLE([debug], +[AS_HELP_STRING([--enable-debug], + [enable debugging code (for developers) @<:@default=no@:>@])]) +if test "x$enable_debug" = xyes; then + AC_DEFINE([_DEBUG], [1], [Define to 1 if you want to include debugging code.]) +fi -AC_OUTPUT(\ - Makefile \ - doc/Makefile \ - progs/Makefile \ - progs/demos/Makefile \ - progs/demos/CallbackMaker/Makefile \ - progs/demos/Fractals/Makefile \ - progs/demos/Fractals_random/Makefile \ - progs/demos/Lorenz/Makefile \ - progs/demos/One/Makefile \ - progs/demos/shapes/Makefile \ - src/Makefile \ - include/Makefile \ - include/GL/Makefile \ - ) +# Generate output. +AC_CONFIG_FILES([ + Makefile + doc/Makefile + include/GL/Makefile + include/Makefile + progs/Makefile + progs/demos/CallbackMaker/Makefile + progs/demos/Fractals/Makefile + progs/demos/Fractals_random/Makefile + progs/demos/Lorenz/Makefile + progs/demos/Makefile + progs/demos/One/Makefile + progs/demos/shapes/Makefile + progs/demos/smooth_opengl3/Makefile + progs/demos/spaceball/Makefile + progs/demos/subwin/Makefile + src/Makefile +]) +AC_OUTPUT