File: configure.ac

package info (click to toggle)
rgl 0.64.13-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,676 kB
  • ctags: 927
  • sloc: cpp: 5,139; sh: 2,643; makefile: 91
file content (136 lines) | stat: -rw-r--r-- 3,432 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
## 
## This file is part of RGL
##
## use src/build/setversion.sh to update configure.ac
## Process this file with autoconf to produce a configure script.
## origin: src/build/autoconf/configure.ac.in
##
## $Id: configure.ac.in,v 1.11 2004/02/27 17:46:51 dadler Exp $
##

AC_PREREQ(2.50)


## ---[ VERSION ]-------------------------------------------------------------

AC_INIT([rgl], [0.64-13], [dadler@uni-goettingen.de])
AC_CONFIG_AUX_DIR(src/build/autoconf)

## ---[ check host ]----------------------------------------------------------

AC_CANONICAL_HOST

##
## ===[ X11 Port ]============================================================
##

## C language

CPPFLAGS=""
CFLAGS="-Wall -pedantic"


## C++ language

LIBS="-lstdc++"
CXXFLAGS="${CFLAGS} -fno-exceptions -fno-rtti"


## X11 backend

AC_PATH_X
if test x$no_x == xyes ; then
  AC_MSG_ERROR([X11 not found, configure aborted.
reason: RGL requires X11 on non-win32 platforms.])
fi

LDFLAGS="${LDFLAGS} -L${x_libraries}"
LIBS="${LIBS} -lX11 -lXext"
CPPFLAGS="${CPPFLAGS} -I${x_includes}"

## OpenGL backend

AC_ARG_WITH(gl-includes,
[  --with-gl-includes=DIR  specify location of OpenGL headers],
[CPPFLAGS="${CPPFLAGS} -I${withval}"]
)

AC_ARG_WITH(gl-libs,
[  --with-gl-libs=DIR      specify location of OpenGL libs],
[LIBS="${LIBS} -L${withval}"]
)

AC_ARG_WITH(gl-libname,
[  --with-gl-libname=NAME specify Library name (defaults to "GL")], 
[LIBS="${LIBS} -l${withval}"], [LIBS="${LIBS} -lGL"]
)

AC_ARG_WITH(glu-libname,
[  --with-glu-libname=NAME specify GLU Library name (defaults to "GLU")],
[LIBS="${LIBS} -l${withval}"], [LIBS="${LIBS} -lGLU"]
)

## LibPNG support

AC_ARG_ENABLE([libpng],
[  --disable-libpng           compile without PNG image support]
)
AC_MSG_RESULT([$enable_libpng])

if test "x$enable_libpng" != "xno"; then

  AC_ARG_ENABLE([libpng-config],
  [  --disable-libpng-config    disable libpng-config test and configuration]
  )
  if test "x$enable_libpng_config" != "xno"; then
    AC_CHECK_PROG([HAVE_LIBPNG_CONFIG],[libpng-config],[yes],[no])
  fi

  if test "x$HAVE_LIBPNG_CONFIG" == "xyes" ; then
    CPPFLAGS="${CPPFLAGS} -DHAVE_PNG_H `libpng-config --cppflags`"
    CFLAGS="${CFLAGS} `libpng-config --cflags`"
    LDFLAGS="${LDFLAGS} `libpng-config --ldflags`"
    LIBS="${LIBS} `libpng-config --libs`"
  else    
    TEST_DIRS="/usr/local /usr"
    for I in $TEST_DIRS ; do
      AC_MSG_CHECKING([libpng in $I])
      if ( test -f $I/lib/libpng.so || test -f $I/lib/libpng.a ) && 
         ( test -f $I/include/png.h ) ; then
        CPPFLAGS="${CPPFLAGS} -DHAVE_PNG_H -I${I}/include"
        LDFLAGS="${LDFLAGS} -L${I}/lib"
        LIBS="${LIBS} -lpng"
        AC_MSG_RESULT([found])
      else
        AC_MSG_RESULT([not found])
      fi
    done
  fi
 
fi

## Darwin/MacOS X stuff

if test `uname` = "Darwin" ; then
  CPPFLAGS="${CPPFLAGS} -DDarwin"
  CFLAGS="${CFLAGS} -DDarwin"
  # Apple's OpenGL is different from the X11 one - it must be loaded *before* X11
  if test -e /System/Library/Frameworks/OpenGL.framework ; then
    CPPFLAGS="-I/System/Library/Frameworks/OpenGL.framework/Headers ${CPPFLAGS} -DNO_GL_PREFIX"
    LIBS="-framework OpenGL ${LIBS}"
  fi
  # X11 must come *after* the OpenGL stuff
  CPPFLAGS="${CPPFLAGS} -I/usr/X11R6/include"
fi

## Output

## AC_SUBST(PLATFORM_MODULES)
AC_SUBST(CPPFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AC_SUBST(DEFS)
    
AC_OUTPUT(src/Makevars)