~ubuntu-branches/ubuntu/saucy/sage/saucy

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2005-10-24 15:31:30 UTC
  • mto: (2.1.1 etch)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051024153130-sofzw63wunzo3bzn
Tags: upstream-0.1.2
ImportĀ upstreamĀ versionĀ 0.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Initialise autoconf
 
2
 
 
3
AC_INIT([sage], [0.1.2])
 
4
AC_CONFIG_HEADERS([config.h])
 
5
 
 
6
dnl Detect the canonical host and target build environment
 
7
AC_CANONICAL_SYSTEM
 
8
 
 
9
SAGE_CURRENT=1
 
10
SAGE_REVISION=0
 
11
SAGE_AGE=1
 
12
SAGE_VERSION_INFO=$SAGE_CURRENT:$SAGE_REVISION:$SAGE_AGE
 
13
 
 
14
AC_SUBST(SAGE_VERSION_INFO)
 
15
 
 
16
SAGE_REQUIRES=""
 
17
 
 
18
AM_INIT_AUTOMAKE([check-news])
 
19
 
 
20
dnl Need libtool
 
21
AC_LIBTOOL_WIN32_DLL
 
22
AM_PROG_LIBTOOL
 
23
AC_PROG_CC
 
24
#AC_MINGW32
 
25
#AC_CYGWIN
 
26
AC_EXEEXT
 
27
 
 
28
case "$target" in
 
29
  *-*-linux*)
 
30
    AC_PATH_X
 
31
    AC_PATH_XTRA
 
32
    LIBS="$LIBS -lGL"
 
33
esac
 
34
 
 
35
case "$target" in
 
36
  *-*-darwin* | *-*-macos*)
 
37
  AC_TRY_COMPILE([
 
38
    #include <OpenGL/gl.h>
 
39
  ],[
 
40
  ],[
 
41
   LIBS="$LIBS -framework OpenGL -framework AGL"
 
42
  ],[
 
43
    AC_TRY_COMPILE([
 
44
      #include <GL/gl.h>
 
45
    ],[
 
46
    ],[
 
47
     LIBS="$LIBS -lGL"
 
48
    ],[
 
49
      AC_MSG_ERROR(Cannot find OpenGL)
 
50
    ])
 
51
  ])
 
52
esac
 
53
 
 
54
case "$host_os" in
 
55
  *cygwin* | *mingw32*)
 
56
    LIBS="$LIBS -lopengl32"
 
57
esac
 
58
 
 
59
if test "$enable_shared" = yes; then
 
60
  if test "x$CYGWIN" = xyes -o "x$MINGW32" = xyes; then
 
61
    SAGE_DLL=sage.dll
 
62
    AC_SUBST(SAGE_DLL)
 
63
    AC_CHECK_TOOL(DLLWRAP, dllwrap)
 
64
    AC_CHECK_TOOL(DLLTOOL, dlltool)
 
65
    BUILD_IT=true
 
66
  else
 
67
    BUILD_IT=false
 
68
  fi
 
69
else
 
70
  BUILD_IT=false
 
71
fi
 
72
 
 
73
AM_CONDITIONAL(BUILD_DLL, test x$SAGE_DLL = xsage.dll, true, false)
 
74
AC_SUBST(BUILD_IT)
 
75
 
 
76
 
 
77
AC_ARG_ENABLE(debug,
 
78
  [  --enable-debug     enable debug information [default=no]],
 
79
  [
 
80
    if test "$enableval" = "yes"; then
 
81
      CFLAGS="$CFLAGS -ggdb -O0 -DDEBUG"
 
82
    else
 
83
      CFLAGS="$CFLAGS -O3 -DNDEBUG"
 
84
    fi
 
85
  ],[
 
86
    CFLAGS="$CFLAGS -O3 -DNDEBUG"
 
87
  ]
 
88
)
 
89
 
 
90
dnl Set compile only flag
 
91
CFLAGS="$CFLAGS -DSAGE_COMPILE"
 
92
 
 
93
dnl Check SDL
 
94
SDL_VERSION=1.2.2
 
95
AC_SUBST(SDL_VERSION)
 
96
AM_PATH_SDL($SDL_VERSION, [
 
97
CFLAGS="$CFLAGS $SDL_CFLAGS"
 
98
LIBS="$LIBS $SDL_LIBS"
 
99
],
 
100
[
 
101
  AC_MSG_ERROR(Couldn't find SDL or insufficent version found. Please goto http://www.libsdl.org/ and get at least version $SDL_VERSION)
 
102
])
 
103
 
 
104
 
 
105
#AC_CHECK_HEADER(windows.h, [], [])
 
106
#AM_CONDITIONAL(BUILD_WGL, test "$ac_cv_header_windows_h" == "yes")
 
107
AM_CONDITIONAL(BUILD_WGL, false)
 
108
 
 
109
AC_CHECK_HEADER(X11/Xlib.h, [], [])
 
110
AM_CONDITIONAL(BUILD_GLX, test "$ac_cv_header_X11_Xlib_h" == "yes")
 
111
AM_CONDITIONAL(BUILD_GLX, false)
 
112
 
 
113
SAGE_LIBS="-lsage"
 
114
SAGE_CFLAGS=""
 
115
 
 
116
AC_SUBST(SAGE_REQUIRES)
 
117
AC_SUBST(SAGE_LIBS)
 
118
AC_SUBST(SAGE_CFLAGS)
 
119
 
 
120
AC_SUBST(PREFIX)
 
121
 
 
122
 
 
123
dnl Generate files
 
124
AC_OUTPUT([
 
125
        Makefile
 
126
        sage/Makefile
 
127
        sage/header.h
 
128
        templates/Makefile
 
129
        sage.spec
 
130
        sage.pc
 
131
        man/Makefile
 
132
        man/man3/Makefile
 
133
])