summaryrefslogtreecommitdiff
path: root/iup/srcconsole/config.mak
blob: 612a3abdd729a87c9cb1474ab98f6ed1524f387b (plain)
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
PROJNAME = iup
APPNAME = iuplua51
APPTYPE = console

LOHDIR = loh
SRCLUA = console5.lua
SRC = iup_lua51.c


# Disable strip
STRIP = 
# Optimize
OPT = YES      

# IM and IupPPlot uses C++
LINKER = $(CPPC)

USE_MOTIF = Yes

ifdef USE_GTK
  APPNAME = iuplua51gtk
endif

ifdef USE_MOTIF
  APPNAME = iuplua51mot
endif

DBG = Yes

ifdef DBG
  # Statically link everything only when debugging
  IUP := ..
  USE_IUPLUA = Yes
  USE_IUP3 = Yes
  USE_STATIC = Yes
  USE_LUA51 = Yes
  
  DEFINES = USE_STATIC

    USE_CDLUA = Yes
    USE_IUPCONTROLS = Yes
    ifneq ($(findstring Win, $(TEC_SYSNAME)), )
      LIBS += iuplua_pplot$(LIBLUASUFX) iup_pplot
    else
      IUPLIB = $(IUP)/lib/$(TEC_UNAME)
      SLIB += $(IUPLIB)/libiuplua_pplot$(LIBLUASUFX).a $(IUPLIB)/libiup_pplot.a
    endif
      
    ifndef IUPLUA_NO_IM
      ifneq ($(findstring Win, $(TEC_SYSNAME)), )
        LIBS += cdluaim$(LIBLUASUFX)
      else
        CDLIB = $(CD)/lib/$(TEC_UNAME)
        SLIB += $(CDLIB)/libcdluaim$(LIBLUASUFX).a
      endif
    endif
    ifneq ($(findstring Win, $(TEC_SYSNAME)), )
      USE_GDIPLUS=Yes
    else
  #    USE_XRENDER=Yes
    endif

    USE_IMLUA = Yes
    
    ifneq ($(findstring Win, $(TEC_SYSNAME)), )
      LIBS += imlua_process$(LIBLUASUFX) iupluaim$(LIBLUASUFX) im_process iupim
    else
      IUPLIB = $(IUP)/lib/$(TEC_UNAME)
      IMLIB = $(IM)/lib/$(TEC_UNAME)
      SLIB +=  $(IMLIB)/libimlua_process$(LIBLUASUFX).a $(IUPLIB)/libiupluaim$(LIBLUASUFX).a $(IMLIB)/libim_process.a $(IUPLIB)/libiupim.a
    endif
    

  IUPLUA_IMGLIB = Yes
  ifdef IUPLUA_IMGLIB
    DEFINES += IUPLUA_IMGLIB
    ifneq ($(findstring Win, $(TEC_SYSNAME)), )
      LIBS += iupluaimglib$(LIBLUASUFX) iupimglib
    else
      IUPLIB = $(IUP)/lib/$(TEC_UNAME)
      SLIB += $(IUPLIB)/libiupluaimglib$(LIBLUASUFX).a $(IUPLIB)/libiupimglib.a
    endif
  endif
else
  ifneq ($(findstring Win, $(TEC_SYSNAME)), )
    # Dinamically link in Windows, when not debugging
    # Must call "tecmake dll8"
    USE_LUA51 = Yes
    USE_DLL = Yes
    GEN_MANIFEST = No
  else
    # In UNIX Lua is always statically linked, late binding is used.
    USE_STATIC = Yes
    USE_LUA51 = Yes
  endif
endif


ifneq ($(findstring Win, $(TEC_SYSNAME)), )
  SLIB += setargv.obj
  SRC += iuplua5.rc
endif

ifneq ($(findstring cygw, $(TEC_UNAME)), )
  LDFLAGS = -s
  LIBS += readline history
endif

ifneq ($(findstring Linux, $(TEC_UNAME)), )
  LIBS += dl 
  #To allow late binding
  LFLAGS = -Wl,-E
  LIBS += readline history curses ncurses
endif

ifneq ($(findstring BSD, $(TEC_UNAME)), )
  #To allow late binding
  LFLAGS = -Wl,-E
  LIBS += readline history curses ncurses
endif

ifneq ($(findstring SunOS, $(TEC_UNAME)), )
  LIBS += dl
endif

ifneq ($(findstring AIX, $(TEC_UNAME)), )
  FLAGS  += -mminimal-toc
  OPTFLAGS = -mminimal-toc -ansi -pedantic 
  LFLAGS = -Xlinker "-bbigtoc"
endif

ifeq ($(TEC_UNAME), vc8)
  ifdef DBG
    #debug info not working for vc8 linker
    define DBG
    endef
  endif
endif