[go: up one dir, main page]

File: configure.ac

package info (click to toggle)
sage 0.2.0-4.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 2,392 kB
  • ctags: 8,086
  • sloc: ansic: 13,739; sh: 8,866; perl: 150; makefile: 109
file content (136 lines) | stat: -rw-r--r-- 2,498 bytes parent folder | download | duplicates (3)
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
dnl Initialise autoconf

AC_INIT([sage], [0.2.0])
AC_CONFIG_HEADERS([config.h])

dnl Detect the canonical host and target build environment
AC_CANONICAL_SYSTEM

SAGE_CURRENT=2
SAGE_REVISION=0
SAGE_AGE=0
SAGE_VERSION_INFO=$SAGE_CURRENT:$SAGE_REVISION:$SAGE_AGE

AC_SUBST(SAGE_VERSION_INFO)

SAGE_REQUIRES=""

AM_INIT_AUTOMAKE([check-news])

dnl Need libtool
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_PROG_CC
#AC_MINGW32
#AC_CYGWIN
AC_EXEEXT

case "$target" in
  *-*-darwin* | *-*-macos*)
  AC_TRY_COMPILE([
    #include <OpenGL/gl.h>
  ],[
  ],[
   LIBS="$LIBS -framework OpenGL -framework AGL"
  ],[
    AC_TRY_COMPILE([
      #include <GL/gl.h>
    ],[
    ],[
     LIBS="$LIBS -lGL"
    ],[
      AC_MSG_ERROR(Cannot find OpenGL)
    ])
  ])
  ;;
  *-*-linux*)
  AC_PATH_X
  AC_PATH_XTRA

  AC_CHECK_LIB(GL,glViewport, [
    LIBS="$LIBS -lGL"
  ],[
    AC_MSG_ERROR(Couldn't find OpenGL)
  ])
esac

case "$host_os" in
  *cygwin* | *mingw32*)
    LIBS="$LIBS -lopengl32"
esac

if test "$enable_shared" = yes; then
  if test "x$CYGWIN" = xyes -o "x$MINGW32" = xyes; then
    SAGE_DLL=sage.dll
    AC_SUBST(SAGE_DLL)
    AC_CHECK_TOOL(DLLWRAP, dllwrap)
    AC_CHECK_TOOL(DLLTOOL, dlltool)
    BUILD_IT=true
  else
    BUILD_IT=false
  fi
else
  BUILD_IT=false
fi

AM_CONDITIONAL(BUILD_DLL, test x$SAGE_DLL = xsage.dll, true, false)
AC_SUBST(BUILD_IT)


AC_ARG_ENABLE(debug,
  [  --enable-debug	enable debug information [default=no]],
  [
    if test "$enableval" = "yes"; then
      CFLAGS="$CFLAGS -ggdb -O0 -DDEBUG"
    else
      CFLAGS="$CFLAGS -O3 -DNDEBUG"
    fi
  ],[
    CFLAGS="$CFLAGS -O3 -DNDEBUG"
  ]
)

dnl Set compile only flag
CFLAGS="$CFLAGS -DSAGE_COMPILE"

dnl Check SDL
SDL_VERSION=1.2.2
AC_SUBST(SDL_VERSION)
AM_PATH_SDL($SDL_VERSION, [
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
],
[
  AC_MSG_ERROR(Couldn't find SDL or insufficent version found. Please goto http://www.libsdl.org/ and get at least version $SDL_VERSION)
])


#AC_CHECK_HEADER(windows.h, [], [])
#AM_CONDITIONAL(BUILD_WGL, test "$ac_cv_header_windows_h" == "yes")
AM_CONDITIONAL(BUILD_WGL, false)

AC_CHECK_HEADER(X11/Xlib.h, [], [])
AM_CONDITIONAL(BUILD_GLX, test "$ac_cv_header_X11_Xlib_h" == "yes")
AM_CONDITIONAL(BUILD_GLX, false)

SAGE_LIBS="-lsage"
SAGE_CFLAGS=""

AC_SUBST(SAGE_REQUIRES)
AC_SUBST(SAGE_LIBS)
AC_SUBST(SAGE_CFLAGS)

AC_SUBST(PREFIX)


dnl Generate files
AC_OUTPUT([
	Makefile
	sage/Makefile
	sage/header.h
	templates/Makefile
	sage.spec
	sage.pc
	man/Makefile
	man/man3/Makefile
])