~ubuntu-branches/ubuntu/lucid/codelite/lucid

« back to all changes in this revision

Viewing changes to configure

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-02-10 02:27:55 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090210022755-m5692nfc1t5uf1w9
Tags: 1.0.2759+dfsg-0ubuntu1
* New upstream release (LP: #327216).
* debian/patches/series, debian/patches/00_fix-ia64-build.patch:
  + Dropped, applied upstream already.
* debian/patches/02_fix-desktop.patch,
  debian/patches/03_fix-sh.patch:
  + Refreshed to patch cleanly.
* debian/rules:
  + Make get-orig-source honour UPSTREAM_VERSION if set.
* debian/ctags-le.1,
  debian/codelite_indexer.1,
  debian/codelite.manpages:
  + Dropped ctags-le manpage, since ctags-le was replaced by
    codelite_indexer.
  + Added codelite_indexer manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
3
3
################################################################################
4
 
## This file is part of CodeLite IDE and is released 
5
 
## under the terms of the GNU General Public License as published by  
6
 
##    the Free Software Foundation; either version 2 of the License, or     
7
 
##    (at your option) any later version.                              
 
4
## This file is part of CodeLite IDE and is released
 
5
## under the terms of the GNU General Public License as published by
 
6
##    the Free Software Foundation; either version 2 of the License, or
 
7
##    (at your option) any later version.
8
8
################################################################################
9
9
 
10
10
createRevisionFile()
21
21
        exe_name="Runtime/codelite"
22
22
        exe_name1="codelite"
23
23
        is_plugin=$1
24
 
        if [ "$arch" = "x86_64" ]; then
 
24
        if [ "$is_64bit" = "yes" ]; then
25
25
                compiler_name=${compiler_name}" -fPIC -DON_64_BIT "
26
26
                c_compiler_name=${c_compiler_name}" -fPIC -DON_64_BIT "
27
27
        fi
57
57
        echo "" >> Makefile
58
58
        echo "CCFLAGS= -Wall \$(shell wx-config --cxxflags \$(WXCFG)) -fno-strict-aliasing -DASTYLE_LIB -DYY_NEVER_INTERACTIVE=1 -DGTK -DSCI_LEXER -DLINK_LEXERS -D__WX__ " >> Makefile
59
59
        echo "LINK_FLAGS =  -L${base_dir}/\$(OUTPUT_DIR) -lplugin\$(EXT) -lcodelite\$(EXT) -lwxsqlite3\$(EXT) \\" >> Makefile
60
 
        echo "  -lwxscintilla\$(EXT) -L${base_dir}/sdk/sqlite3/lib \$(shell wx-config --libs \$(WXCFG))" >> Makefile
 
60
        echo "  -lwxscintilla\$(EXT) -lwxpropgrid\$(EXT) -L${base_dir}/sdk/sqlite3/lib \$(shell wx-config --libs \$(WXCFG))" >> Makefile
61
61
 
62
62
 
63
63
        if [ "$is_plugin" = "no" ]; then
70
70
        else
71
71
                echo "CCFLAGS := \$(CCFLAGS) -D__APPLE__ -DMACOSX" >> Makefile
72
72
        fi
73
 
        echo "INCLUDES := \$(INCLUDES) -I. -I${base_dir}/sdk/wxsqlite3/include -I${base_dir}/sdk/wxsqlite3/sqlite3/include -I${base_dir}/sdk/wxscintilla/include -I${base_dir}/sdk/wxscintilla/src/scintilla/include     -I${base_dir}/sdk/wxscintilla/src/scintilla/src -I${base_dir}/Interfaces -I${base_dir}/Debugger -I${base_dir}/Plugin -I${base_dir}/CodeLite " >> Makefile
 
73
        echo "INCLUDES := \$(INCLUDES) -I. -I${base_dir}/sdk/wxsqlite3/include -I${base_dir}/sdk/wxsqlite3/sqlite3/include -I${base_dir}/sdk/wxscintilla/include -I${base_dir}/sdk/wxscintilla/src/scintilla/include -I${base_dir}/sdk/wxpropgrid/include        -I${base_dir}/sdk/wxscintilla/src/scintilla/src -I${base_dir}/Interfaces -I${base_dir}/Debugger -I${base_dir}/Plugin -I${base_dir}/CodeLite " >> Makefile
74
74
        echo "" >> Makefile
75
75
        echo "" >> Makefile
76
76
}
80
80
        echo "## build targets" >> Makefile
81
81
 
82
82
        ## default
83
 
        target_all="all :  pre_build CodeLite Scintilla SQLite SDK LiteEditor ctags Plugins "
 
83
        target_all="all :  pre_build CodeLite Scintilla SQLite PropGrid SDK LiteEditor codelite_indexer Plugins "
84
84
 
85
85
        ## if we are on Linux, print the post message
86
86
        if [ "$os_name" = "Linux" ]; then
87
 
                target_all="all :  pre_build CodeLite Scintilla SQLite SDK LiteEditor ctags Plugins post_build_msg"
 
87
                target_all="all :  pre_build CodeLite Scintilla SQLite PropGrid SDK LiteEditor codelite_indexer Plugins post_build_msg"
88
88
        fi
89
89
 
90
90
        if [ "$os_name" = "Darwin" ]; then
91
 
                target_all="all :  pre_build CodeLite Scintilla SQLite SDK LiteEditor ctags Plugins mac_bundle"
 
91
                target_all="all :  pre_build CodeLite Scintilla SQLite PropGrid SDK LiteEditor codelite_indexer Plugins mac_bundle"
92
92
        fi
93
93
 
94
94
        ## add the "all" target to the makefile
95
95
        echo "${target_all}" >> Makefile
96
96
        echo "" >> Makefile
97
97
 
98
 
        echo "ctags: sdk/ctags/Makefile" >> Makefile
99
 
        echo "  @cd sdk/ctags/ && \$(MAKE)" >> Makefile
100
 
        echo "  cp -fr sdk/ctags/ctags-le Runtime/." >> Makefile
101
 
        echo "" >> Makefile
102
 
 
103
 
        echo "sdk/ctags/Makefile: sdk/ctags/source.mak" >> Makefile
104
 
        echo "  @chmod +x sdk/ctags/configure" >> Makefile
105
 
        echo "  cd sdk/ctags && ./configure" >> Makefile
 
98
        echo "codelite_indexer:" >> Makefile
 
99
        echo "  @cd sdk/codelite_indexer/ && \$(MAKE)" >> Makefile
 
100
        echo "  cp -fr sdk/codelite_indexer/codelite_indexer Runtime/." >> Makefile
106
101
        echo "" >> Makefile
107
102
 
108
103
        echo "pre_build:" >> Makefile
181
176
        echo >> Makefile
182
177
}
183
178
 
 
179
createCodeLiteIndexerMakefile ()
 
180
{
 
181
        files_list=$1
 
182
        echo "Generating sdk/codelite_indexer/Makefile..."
 
183
        current_wd=`pwd`
 
184
 
 
185
        cd sdk/codelite_indexer/
 
186
 
 
187
        ## remove old Makefile
 
188
        rm -fr Makefile
 
189
 
 
190
        compiler_name="g++ "
 
191
        c_compiler_name="gcc "
 
192
        if [ "$is_64bit" = "yes" ]; then
 
193
                compiler_name=${compiler_name}" -fPIC -DON_64_BIT "
 
194
                c_compiler_name=${c_compiler_name}" -fPIC -DON_64_BIT "
 
195
        fi
 
196
        ## set the executable name
 
197
        if [ "$enable_debug" = "yes" ]; then
 
198
                debug_flag=" -g "
 
199
                configuration="Debug"
 
200
                optimization=" -O0 "
 
201
        else
 
202
                configuration="Release"
 
203
                debug_flag=""
 
204
                optimization=" -O2 "
 
205
        fi
 
206
 
 
207
        echo "OPT=${optimization}" >> Makefile
 
208
        echo "DEBUG=${debug_flag}" >> Makefile
 
209
        echo "CMP=${compiler_name} \$(DEBUG) \$(OPT) " >> Makefile
 
210
        echo "GCC=${c_compiler_name} \$(DEBUG) \$(OPT) " >> Makefile
 
211
        echo "" >> Makefile
 
212
        echo "all: codelite_indexer" >> Makefile
 
213
 
 
214
        createObjectList "network/*.cpp libctags/*.c *.cpp" "codelite_indexer_objects"
 
215
 
 
216
        for a_file in $files_list
 
217
        do
 
218
                a_file_with_ext=`basename $a_file`
 
219
                a_file_no_ext=`basename $a_file .cxx`
 
220
                a_file_no_ext=`basename $a_file_no_ext .cpp`
 
221
                a_file_no_ext=`basename $a_file_no_ext .c`
 
222
                file_extension=`basename $a_file | cut -d. -f2`
 
223
 
 
224
                if [ "$file_extension" = "c" ]; then
 
225
                        echo ${configuration}/${a_file_no_ext}.o: ${a_file} ${configuration}/${a_file_no_ext}.o.d >> Makefile
 
226
                        echo "  \$(GCC) -DHAVE_CONFIG_H -I. -Ilibctags -c ${a_file} -o ${configuration}/${a_file_no_ext}.o" >> Makefile
 
227
                        echo ${configuration}/${a_file_no_ext}.o.d:  >> Makefile
 
228
                        echo "  \$(GCC) -DHAVE_CONFIG_H -I. -Ilibctags  -MT${configuration}/${a_file_no_ext}.o -MF${configuration}/${a_file_no_ext}.o.d  -MM ${a_file}" >> Makefile
 
229
                else
 
230
                        echo ${configuration}/${a_file_no_ext}.o: ${a_file} ${configuration}/${a_file_no_ext}.o.d >> Makefile
 
231
                        echo "  \$(CMP) -DHAVE_CONFIG_H -I. -Ilibctags -c ${a_file} -o ${configuration}/${a_file_no_ext}.o" >> Makefile
 
232
                        echo ${configuration}/${a_file_no_ext}.o.d:  >> Makefile
 
233
                        echo "  \$(CMP) -DHAVE_CONFIG_H -I. -Ilibctags  -MT${configuration}/${a_file_no_ext}.o -MF${configuration}/${a_file_no_ext}.o.d  -MM ${a_file}" >> Makefile
 
234
                fi
 
235
 
 
236
                echo "-include ${configuration}/*.d" >> Makefile
 
237
        done
 
238
        echo >> Makefile
 
239
 
 
240
        echo "codelite_indexer: make_dirs \$(codelite_indexer_objects)" >> Makefile
 
241
 
 
242
        ## On FreeBSD, -ldl is part og libc
 
243
        if [ "$os_name" = "FreeBSD" ]; then
 
244
                echo "  \$(CMP) -o codelite_indexer \$(codelite_indexer_objects) -lpthread " >> Makefile
 
245
        else
 
246
                echo "  \$(CMP) -o codelite_indexer \$(codelite_indexer_objects) -lpthread -ldl " >> Makefile
 
247
        fi
 
248
 
 
249
        echo >> Makefile
 
250
 
 
251
        echo "make_dirs:" >> Makefile
 
252
        echo "  @echo" >> Makefile
 
253
        echo "  @echo \"----------Building project:[ codelite_indexer - ${configuration} ]----------\"" >> Makefile
 
254
        echo "  @echo" >> Makefile
 
255
        echo "  test -d ${configuration} || mkdir ${configuration}" >> Makefile
 
256
        echo >> Makefile
 
257
 
 
258
        echo "clean: " >> Makefile
 
259
        echo "  \$(RM) -fr ${configuration}/*.o" >> Makefile
 
260
        echo "  \$(RM) -fr ${configuration}/*.o.d" >> Makefile
 
261
        echo "  \$(RM) -fr codelite_indexer" >> Makefile
 
262
 
 
263
        ## restore the path
 
264
        cd ${current_wd}
 
265
}
 
266
 
184
267
createRules_sharedObject_no_link_flags ()
185
268
{
186
269
        files_list=$1
265
348
        echo "${rule_name}: \$(${object_list_name})" >> Makefile
266
349
        echo "  \$(CMP) ${shared_obj_switch} -o ${base_dir}/\$(OUTPUT_DIR)/${libname}.so \$(${object_list_name}) \$(LINK_FLAGS)" >> Makefile
267
350
        echo >> Makefile
 
351
        echo "-include ${configuration}/*.o.d" >> Makefile
 
352
        echo >> Makefile
268
353
}
269
354
 
270
355
createRules_exe ()
392
477
        echo "  @chmod +x \$(DESTDIR)$prefix/bin/le_dos2unix.sh" >> Makefile
393
478
        echo "  @chmod +x \$(DESTDIR)$prefix/bin/le_exec.sh" >> Makefile
394
479
        echo "  @chmod +x \$(DESTDIR)$prefix/bin/le_killproc.sh" >> Makefile
395
 
        echo "  @cp sdk/ctags/ctags-le \$(DESTDIR)$prefix/bin/" >> Makefile
 
480
        echo "  @cp sdk/codelite_indexer/codelite_indexer \$(DESTDIR)$prefix/bin/" >> Makefile
396
481
        echo "  @mkdir -p \$(DESTDIR)$prefix/share/applications" >> Makefile
397
482
        echo "  @mkdir -p \$(DESTDIR)$prefix/share/codelite" >> Makefile
398
483
        echo "  @mkdir -p \$(DESTDIR)$prefix/share/codelite/config" >> Makefile
452
537
        echo "  @\$(RM) -fr  \$(DESTDIR)$prefix/bin/le_dos2unix.sh" >> Makefile
453
538
        echo "  @\$(RM) -fr  \$(DESTDIR)$prefix/bin/le_exec.sh" >> Makefile
454
539
        echo "  @\$(RM) -fr  \$(DESTDIR)$prefix/bin/le_killproc.sh" >> Makefile
455
 
        echo "  @\$(RM) -fr  \$(DESTDIR)$prefix/bin/ctags-le" >> Makefile
 
540
        echo "  @\$(RM) -fr  \$(DESTDIR)$prefix/bin/codelite_indexer" >> Makefile
456
541
        echo "  @\$(RM) -fr  \$(DESTDIR)$prefix/bin/CodeLiteUR" >> Makefile
457
542
        echo "  @\$(RM) -fr  \$(DESTDIR)$prefix/bin/CodeLiteUD" >> Makefile
458
543
        echo "  @\$(RM) -fr  \$(DESTDIR)$prefix/bin/codelite" >> Makefile
514
599
os_name=`uname -s`
515
600
arch=`uname -m`
516
601
 
 
602
## Determine if we are on 64 bit machine
 
603
## AMD / Interl will produce x86_64
 
604
## while itanium produces ia64
 
605
is_64bit="no"
 
606
if [ "$arch" = "x86_64" ] || [ "$arch" = "ia64" ]; then
 
607
        is_64bit="yes"
 
608
fi
517
609
 
518
610
## Process any arguments that were supplied
519
611
until [ -z "$1" ]  # Until all parameters used up
562
654
createObjectList "CodeLite/*.cpp" "CodeLiteObjects"
563
655
createObjectList "LiteEditor/*.cpp" "LiteEditorObjects"
564
656
createObjectList "sdk/wxsqlite3/src/*.cpp sqlite3/*.c" "wxSqlite3Objects"
 
657
createObjectList "sdk/wxpropgrid/src/*.cpp" "wxPropGridObjects"
565
658
createObjectList "Plugin/*.cpp" "SDKObjects"
566
659
 
567
660
createMainTargets
571
664
createRules_archive "sdk/wxscintilla/src/scintilla/src/*.cxx sdk/wxscintilla/src/*.cpp" "ScintillaObjects" "Scintilla" "wxscintilla"
572
665
createRules_archive "CodeLite/*.cpp" "CodeLiteObjects" "CodeLite" "codelite"
573
666
createRules_archive "sdk/wxsqlite3/src/*.cpp sqlite3/*.c" "wxSqlite3Objects" "SQLite" "wxsqlite3"
 
667
createRules_archive "sdk/wxpropgrid/src/*.cpp" "wxPropGridObjects" "PropGrid" "wxpropgrid"
574
668
createRules_archive "Plugin/*.cpp " "SDKObjects" "SDK" "plugin"
575
669
createRules_exe "LiteEditor/*.cpp" "LiteEditorObjects" "LiteEditor" ${exe_name}
 
670
createCodeLiteIndexerMakefile "sdk/codelite_indexer/*.cpp sdk/codelite_indexer/network/*.cpp sdk/codelite_indexer/libctags/*.c sdk/codelite_indexer/libctags/*.cpp"
576
671
createInstallTarget
577
672
createUnInstallTarget
578
673