Menu

[r806]: / trunk / LWJGL / src / native / configure.in  Maximize  Restore  History

Download this file

88 lines (70 with data), 2.7 kB

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

#AC_PREREQ(2.57)
AC_INIT(LWJGL, 0.7)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR([autogen.sh])
AM_CONFIG_HEADER([config.h])

AC_DISABLE_STATIC

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

AC_PROG_CXX
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--disable-buidl], [Disable debug build]),
[build_debug=$enableval], [build_debug=no])

if test $build_debug = yes; then
  DEBUG_FLAGS=-D_DEBUG
else
  DEBUG_FLAGS=
fi

AC_CANONICAL_HOST

case "$host_os" in
        darwin*)        _BUILD_FLAGS="-D_AGL -fpascal-strings"
	                LDFLAGS="-Xlinker -framework -Xlinker Carbon -Xlinker -framework -Xlinker JavaVM"
			NATIVE_BUILD_DIR=macosx
                        CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS -Wall $_BUILD_FLAGS"
                        CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall $_BUILD_FLAGS"
                        ;;
	bsdi* | linux* | solaris*) AC_PATH_XTRA
                                   AC_LIBTOOL_DLOPEN
                                   _BUILD_FLAGS="-pthread -D_X11 $X_CFLAGS"
                                   AC_CHECK_HEADERS([AL/altypes.h AL/alctypes.h],, AC_MSG_ERROR([OpenAL headers required]))
				   NATIVE_BUILD_DIR=linux
                                   CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS -Wall $_BUILD_FLAGS"
                                   CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall $_BUILD_FLAGS"
                                   LIBS="$LIBS $X_LIBS"
                                   AC_CHECK_LIB(X11, XOpenDisplay,, AC_MSG_ERROR(X11 is required))
                                   AC_CHECK_LIB(Xext, main,, AC_MSG_ERROR(Xext is required))
                                   AC_CHECK_LIB(Xxf86vm, main,, AC_MSG_ERROR(Xxf86vm is required))
                                   AC_CHECK_LIB(pthread, pthread_create,, AC_MSG_ERROR(pthread is required))
                                   ;;
        *)              AC_MSG_ERROR([Unsupported system $host_os]);;
esac

CC="$CXX"
AC_PROG_LIBTOOL 

AC_JNI_INCLUDE_DIR

for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
do
    CXXFLAGS="$CXXFLAGS -I$JNI_INCLUDE_DIR"
done

AC_SUBST(native_build_dir, [$NATIVE_BUILD_DIR])

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC

AC_CHECK_HEADER([stddef.h stdlib.h string.h sys/time.h])

# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday memset strchr strstr])

AC_CONFIG_FILES([Makefile
                 common/Makefile
                 linux/Makefile
		 macosx/Makefile])
AC_OUTPUT
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.