File: configure.ac

package info (click to toggle)
gpt 1.1-8
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,128 kB
  • sloc: sh: 9,899; cpp: 6,783; makefile: 146
file content (176 lines) | stat: -rw-r--r-- 3,559 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#Nota windows:
#aclocal do cygwin fica feliz somente
#tiver quebra de linha no format UNIX

AC_PREREQ(2.60)

AC_INIT(gpt, 1.1)
AM_INIT_AUTOMAKE(gpt, 1.1)
AC_CONFIG_HEADER([config.h])
AC_LANG(C++)
AC_PROG_CXX
AM_PROG_LIBTOOL


dnl------------------------------
dnl debug options
dnl------------------------------

AC_ARG_ENABLE(debug,
        AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
[
  case $enableval in
    yes)
      use_debug_code="yes"
      use_debug_define=yes
      ;;
    full)
      use_debug_code="full"
      use_debug_define=yes
      ;;
    *)
      use_debug_code="no"
      use_debug_define=no
      ;;
  esac
],
  [use_debug_code="no"
    use_debug_define=no
])

CXXFLAGS=
if test "$use_debug_code" != "no"; then
  if test $use_debug_code = "full"; then
    CXXFLAGS="-g3 $CXXFLAGS"
  else
    CXXFLAGS="-g -O2 $CXXFLAGS"
  fi
else
  CXXFLAGS="-O2 $CXXFLAGS"
fi

if test "$use_debug_define" = "yes"; then
  CXXFLAGS="-DDEBUG $CXXFLAGS"
fi


dnl------------------------------
dnl Check SO
dnl------------------------------

if test $version_type = "windows"; then
   SO_WINDOWS="yes"
else
   SO_WINDOWS="no"
fi

AM_CONDITIONAL(BUILD_DEBUGGER, test x$SO_WINDOWS = xno)

dnl------------------------------
dnl Checks for ANTLR
dnl------------------------------

AC_PATH_PROG(ANTLR_BIN, runantlr)

if test "x${ANTLR}" = "x"; then
  AC_PATH_PROG(ANTLR_BIN, runantlr)
fi

if test "x${ANTLR_BIN}" = "x"; then
  AC_MSG_ERROR(
  [
    O programa "antlr" (ou runantlr) nao foi encontrado no seu sistema (PATH).
    GPT precisa do ANTLR (versao 2.7.x) instalado.
    Baixe em: http://www.antlr.org
  ])
fi

AC_PATH_PROG(ANTLR_CFG, antlr-config)
if test "x${ANTLR_CFG}" = "x"; then
  AC_MSG_ERROR(
  [
    O programa "antlr-config" nao foi encontrado no seu sistema (PATH).
    GPT precisa do ANTLR (versao 2.7.x) instalado.
    Baixe em: http://www.antlr.org
  ])
fi

ANTLR_LIB=`${ANTLR_CFG} --libs`
ANTLR_INC=`${ANTLR_CFG} --cflags`

AC_SUBST(ANTLR_BIN)
AC_SUBST(ANTLR_INC)
AC_SUBST(ANTLR_LIB)


dnl------------------------------
dnl checks for PCRE
dnl------------------------------

# AC_MSG_CHECKING(for pcre)

AC_CHECK_PROG(has_pcre, pcre2-config, yes)

if test "x$has_pcre" = "xyes"; then
  PCRE_CONFIG="pcre2-config"
else
  AC_MSG_ERROR(
  [
    GPT precisa da biblioteca PCRE instalada
    Baixe em: http://www.pcre.org/
  ])
fi

#pcrecpp

PCRE_INC=`${PCRE_CONFIG} --cflags`
PCRE_LIB=`${PCRE_CONFIG} --libs8`
AC_SUBST(PCRE_INC)
AC_SUBST(PCRE_LIB)


dnl------------------------------
dnl checks if we want to install
dnl the libs and headers
dnl------------------------------

AC_ARG_ENABLE([install-devel],
    [AC_HELP_STRING([--enable-install-devel],
                    [instala bibliotecas e headers])],
    [INSTALL_DEVEL="yes"],
    [INSTALL_DEVEL="no"]
)

AM_CONDITIONAL(INSTALL_DEVEL, test x$INSTALL_DEVEL = xyes)


dnl------------------------------
dnl the end
dnl------------------------------

AC_OUTPUT(Makefile
        src/Makefile
        doc/Makefile
        doc/man/Makefile
        doc/man/pt_BR/Makefile
        exemplos/Makefile
        lib/Makefile
        src/modules/Makefile
        src/modules/parser/Makefile
        src/modules/interpreter/Makefile
        src/modules/c_translator/Makefile
        src/modules/x86/Makefile
      )

AC_MSG_NOTICE([
Sumario:
	antlr           : $ANTLR_BIN
	antlr includes  : $ANTLR_INC
	antr lib        : $ANTLR_LIB

	pcre includes   : $PCRE_INC
	pcre lib        : $PCRE_LIB

	CXXFLAGS        : $CXXFLAGS
	MS Windows      : $SO_WINDOWS
])