Commit d050bcab authored by Benoît Minisini's avatar Benoît Minisini

[CONFIGURATION]

* NEW: Modify the installation process so that it will be able to run the 
  'gbh3' tool to extract help from component source files. Not usable yet
  as long as 'gbh3' depends on 'gb.pcre'.

[HELP EXTRACTOR]
* NEW: Move 'gbh3' project from '/app/src' to '/main/tools'.
* NEW: Add new options that are needed by the installation process.


git-svn-id: svn://localhost/gambas/trunk@6829 867c0c6c-44f3-4631-809d-bfa615b0a4ec
parent b875e459
...@@ -39,6 +39,7 @@ install-exec-local: ...@@ -39,6 +39,7 @@ install-exec-local:
xdg-icon-resource install --context mimetypes --size 64 $(DESTDIR)$(gbdatadir)/icons/application-x-gambasserverpage.png application-x-gambasserverpage; \ xdg-icon-resource install --context mimetypes --size 64 $(DESTDIR)$(gbdatadir)/icons/application-x-gambasserverpage.png application-x-gambasserverpage; \
xdg-mime install $(srcdir)/mime/application-x-gambasserverpage.xml; \ xdg-mime install $(srcdir)/mime/application-x-gambasserverpage.xml; \
fi fi
@echo "Installing the Gambas appdata file" @echo "Installing the Gambas appdata file"
@$(INSTALL) -d $(DESTDIR)$(datarootdir)/appdata @$(INSTALL) -d $(DESTDIR)$(datarootdir)/appdata
@$(INSTALL) $(srcdir)/desktop/gambas3.appdata.xml $(DESTDIR)$(datarootdir)/appdata @$(INSTALL) $(srcdir)/desktop/gambas3.appdata.xml $(DESTDIR)$(datarootdir)/appdata
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
Title=Md2Model example Title=Md2Model example
Startup=FMain Startup=FMain
Icon=icon.png Icon=icon.png
Version=3.6.90 Version=1.0.0
VersionFile=1
Component=gb.image Component=gb.image
Component=gb.gui Component=gb.gui
Component=gb.db Component=gb.db
...@@ -13,6 +12,10 @@ Component=gb.gui.opengl ...@@ -13,6 +12,10 @@ Component=gb.gui.opengl
Component=gb.opengl Component=gb.opengl
Component=gb.opengl.glu Component=gb.opengl.glu
Component=gb.opengl.sge Component=gb.opengl.sge
Description="This example shows how to use the 'gb.opengl.sge' component and OpenGL to display a lot of animated monster."
Authors="Benoît Minisini"
Environment="GB_GUI=gb.qt4" Environment="GB_GUI=gb.qt4"
TabSize=2 TabSize=2
Language=fr
Vendor=Example
Packager=1 Packager=1
...@@ -2,7 +2,7 @@ FMain ...@@ -2,7 +2,7 @@ FMain
Md2Model example Md2Model example
0 0
0 0
3.6.90 1.0.0
gb.image gb.image
gb.gui gb.gui
......
# Gambas Project File 3.0 # Gambas Project File 3.0
# Compiled with Gambas 3.5.90 # Compiled with Gambas 3.6.90
Title=OpenGL tutorials from NeHe Title=OpenGL tutorials from NeHe
Startup=MMain Startup=MMain
Icon=icon.png Icon=icon.png
Version=3.6.2 Version=3.6.90
VersionFile=1 VersionFile=1
Component=gb.image Component=gb.image
Component=gb.image.io Component=gb.image.io
......
# Gambas Project File 3.0 # Gambas Project File 3.0
# Compiled with Gambas 3.5.90 # Compiled with Gambas 3.6.90
Title=PDF Presentation Title=PDF Presentation
Startup=MMain Startup=MMain
Icon=icon.png Icon=icon.png
Version=3.6.2 Version=3.6.90
VersionFile=1 VersionFile=1
Component=gb.image Component=gb.image
Component=gb.gui Component=gb.gui
...@@ -18,6 +18,7 @@ Description="OpenGL PDF presentation" ...@@ -18,6 +18,7 @@ Description="OpenGL PDF presentation"
Authors="Laurent Carlier\nBenoit Minisini" Authors="Laurent Carlier\nBenoit Minisini"
Environment="GB_GUI=gb.qt" Environment="GB_GUI=gb.qt"
TabSize=2 TabSize=2
Language=fr
Maintainer=benoit Maintainer=benoit
Vendor=Princeton Vendor=Princeton
Address=benoit@localhost Address=benoit@localhost
......
...@@ -26,9 +26,9 @@ SearchString=True ...@@ -26,9 +26,9 @@ SearchString=True
[OpenFile] [OpenFile]
File[1]=".src/MMain.module:7.0" File[1]=".src/MMain.module:7.0"
Active=2 Active=4
File[2]=".src/FMain.class:41.2" File[2]=".src/FMain.class:41.2"
File[3]=".src/CpdfPresentation.class:106.2" File[3]=".src/CPdfPresentation.class:358.18"
File[4]=".src/FMain.form" File[4]=".src/FMain.form"
Count=4 Count=4
......
...@@ -6,7 +6,6 @@ Public FrameRate As Integer = 50 ...@@ -6,7 +6,6 @@ Public FrameRate As Integer = 50
Public Sub Main() Public Sub Main()
Print Env["GB_GUI"]
FMain.Show FMain.Show
End End
......
This diff is collapsed.
...@@ -82,14 +82,15 @@ SearchComment=False ...@@ -82,14 +82,15 @@ SearchComment=False
SearchString=True SearchString=True
[OpenFile] [OpenFile]
Active=1 Active=4
File[1]=".src/MMain.module:336.45" File[1]=".src/MMain.module:336.45"
File[2]=".src/MServerPage.module:3.0" File[2]=".src/MServerPage.module:3.0"
File[3]=".src/CComponent.class:38.0" File[3]=".src/CComponent.class:38.0"
File[4]="usage-gbs:12.0" File[4]="usage-gbs:0.0"
File[5]="license:0.13" File[5]="license:0.4"
File[6]="usage-gbw:0.0" File[6]="usage-gbw:0.0"
Count=6 Count=7
File[7]="icon.png"
[VersionControl] [VersionControl]
User="gambas" User="gambas"
......
(c) 2007-2014 Fabien Bodard, Benoît Minisini (c) Fabien Bodard, Benoît Minisini
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as modify it under the terms of the GNU General Public License as
......
...@@ -38,6 +38,9 @@ install-data-hook: ...@@ -38,6 +38,9 @@ install-data-hook:
$(INSTALL) $(COMPONENT)/.hidden/control/*.png $(DESTDIR)$(gbdatadir)/control/$(COMPONENT); \ $(INSTALL) $(COMPONENT)/.hidden/control/*.png $(DESTDIR)$(gbdatadir)/control/$(COMPONENT); \
fi fi
@echo "Creating the information files for $(COMPONENT) component..." @echo "Creating the information files for $(COMPONENT) component..."
@if test "$(EXTRACT_HELP)" = "1"; then \
$(DESTDIR)$(bindir)/gbh$(GAMBAS_VERSION) -r $(DESTDIR)$(prefix) -c $(COMPONENT); \
fi
@$(DESTDIR)$(bindir)/gbi$(GAMBAS_VERSION) -r $(DESTDIR)$(prefix) > /dev/null @$(DESTDIR)$(bindir)/gbi$(GAMBAS_VERSION) -r $(DESTDIR)$(prefix) > /dev/null
@echo @echo
......
ACLOCAL_AMFLAGS = -I m4 --install ACLOCAL_AMFLAGS = -I m4 --install
SUBDIRS = gbc gbx lib share SUBDIRS = gbc gbx . lib share
EXTRA_DIST = TODO reconf spec README mime gb.*.h EXTRA_DIST = TODO reconf tools spec README mime gb.*.h
BUILT_SOURCES = trunk_version.h BUILT_SOURCES = trunk_version.h
CLEANFILES = trunk_version.h CLEANFILES = trunk_version.h
...@@ -36,6 +36,29 @@ install-exec-local: ...@@ -36,6 +36,29 @@ install-exec-local:
xdg-mime install $(srcdir)/mime/application-x-gambas3.xml; \ xdg-mime install $(srcdir)/mime/application-x-gambas3.xml; \
fi fi
@echo "Creating the information files for gb component..."
@$(INSTALL) -d $(DESTDIR)$(gbdatadir)/info
@$(DESTDIR)$(bindir)/gbi$(GAMBAS_VERSION) -r $(DESTDIR)$(prefix) gb
@rm -f $(DESTDIR)$(gblibdir)/lib.gb.la
@rm -f $(DESTDIR)$(gblibdir)/lib.gb.so*
@$(INSTALL) lib/gb.component $(DESTDIR)$(gblibdir)
@echo "Installing the compiler tools..."
@(cd $(srcdir)/tools; d=`pwd`; \
for p in gb*; do \
echo "Compiling $$p..."; cd $$d/$$p; \
$(DESTDIR)$(bindir)/gbc$(GAMBAS_VERSION) -ag -r $(DESTDIR)$(prefix); \
if test $$? -eq 0; then \
$(DESTDIR)$(bindir)/gba$(GAMBAS_VERSION); \
rm -rf .gambas; \
echo "Installing $$p..."; \
$(INSTALL) $$p.gambas $(DESTDIR)$(bindir); \
ln -s $$p.gambas $(DESTDIR)$(bindir)/$$p || true; \
else \
echo "|| Unable to compile $$p" >> ../../../warnings.log; \
fi \
done)
uninstall-local: uninstall-local:
@rm -f $(DESTDIR)$(bindir)/gbr$(GAMBAS_VERSION) @rm -f $(DESTDIR)$(bindir)/gbr$(GAMBAS_VERSION)
@rm -rf $(DESTDIR)$(gblibdir)/info @rm -rf $(DESTDIR)$(gblibdir)/info
...@@ -43,6 +66,14 @@ uninstall-local: ...@@ -43,6 +66,14 @@ uninstall-local:
xdg-mime uninstall $(srcdir)/mime/application-x-gambas3.xml; \ xdg-mime uninstall $(srcdir)/mime/application-x-gambas3.xml; \
xdg-icon-resource uninstall --context mimetypes --size 64 application-x-gambas3; \ xdg-icon-resource uninstall --context mimetypes --size 64 application-x-gambas3; \
fi fi
@(cd $(srcdir)/tools; for p in gb*; do rm -f $(DESTDIR)$(bindir)/$$p.gambas $(DESTDIR)$(bindir)/$$p; done)
@rm -f $(DESTDIR)$(gblibdir)gb.component
@rm -rf $(DESTDIR)$(gbdatadir)/info/gb.info
@rm -rf $(DESTDIR)$(gbdatadir)/info/gb.list
dist-hook: dist-hook:
@rm -f $(distdir)/trunk_version.h @rm -f $(distdir)/trunk_version.h
@(cd $(distdir)/tools; \
rm -rf `find . -name ".gambas" -o -name ".action" -o -name ".lock" -o -name ".xvpics" -o -name "*~" -o -name "*.out" -o -name "*.pot" -o -name "*.gambas" -o -name "core*" -o -name ".kdbg*" -o -name ".svn"`;)
...@@ -793,7 +793,7 @@ int main(int argc, char **argv) ...@@ -793,7 +793,7 @@ int main(int argc, char **argv)
printf( printf(
"\nGenerate component description files.\n" "\nGenerate component description files.\n"
"\nUsage: gbi" GAMBAS_VERSION_STRING " [options] [components]\n" "\nUsage: gbi" GAMBAS_VERSION_STRING " [options] [components]\n"
"Options:" "\nOptions:"
#if HAVE_GETOPT_LONG #if HAVE_GETOPT_LONG
"\n" "\n"
#if DO_PRELOADING #if DO_PRELOADING
......
SUBDIRS = . debug eval db compress vb option geom draw image gui gui.opengl \ SUBDIRS = debug eval db compress vb option geom draw image gui gui.opengl \
image.effect signal complex data clipper @INOTIFY_DIR@ image.effect signal complex data clipper @INOTIFY_DIR@
dist_gblib_DATA = gb.component
gblib_DATA = gb.component
install-data-hook:
@echo
@echo "Creating the information files for gb component..."
@$(INSTALL) -d $(DESTDIR)$(gbdatadir)/info
@$(DESTDIR)$(bindir)/gbi$(GAMBAS_VERSION) -r $(DESTDIR)$(prefix) gb
@rm -f $(DESTDIR)$(gblibdir)/lib.gb.la
@rm -f $(DESTDIR)$(gblibdir)/lib.gb.so*
uninstall-hook:
@rm -rf $(DESTDIR)$(gblibdir)gb.component
@rm -rf $(DESTDIR)$(gbdatadir)/info/gb.info
@rm -rf $(DESTDIR)$(gbdatadir)/info/gb.list
COMPONENT = gb.data COMPONENT = gb.data
## EXTRACT_HELP = 1
include $(top_srcdir)/component.am include $(top_srcdir)/component.am
gblib_LTLIBRARIES = gb.data.la gblib_LTLIBRARIES = gb.data.la
......
[Desktop Entry]
Icon=./.icon.png
#---- Gambas files to ignore (v1)
*.gambas
.lock
*~
core
core.*
vgcore
vgcore.*
.kdbg*
.*.prof
.lang/*.pot
.gambas/*
#----
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
# Compiled with Gambas 3.6.90 # Compiled with Gambas 3.6.90
Title=gbh3 Title=gbh3
Startup=MMain Startup=MMain
Icon=icon.png
Version=3.6.90 Version=3.6.90
VersionFile=1
Component=gb.pcre Component=gb.pcre
Description="Extract help comments from C/C++ source files and format them into a .help file." Description="Extract help comments from C/C++ source files and format them into a .help file."
Authors="(C) 2014 Tobias Boege <tobias@gambas-buch.de>, GPLv2+" Authors="(C) 2014 Tobias Boege <tobias@gambas-buch.de>, GPLv2+"
......
' Gambas module file ' Gambas module file
Private $sRoot As String
Private $sComponent As String
Private $bVerbose As Boolean
Private Sub PrintError(sErr As String)
Error File.Name(Args[0]); ": error: "; sErr
Quit 1
End
Private Sub PrintMessage(sMsg As String)
If Not $bVerbose Then Return
Error sMsg
End
Public Sub Main() Public Sub Main()
Dim iInd As Integer, aSources As New String[] Dim iInd As Integer, aSources As New String[]
Dim sArg, sRec As String, aRec As String[] Dim sArg, sRec As String, aRec As String[]
Dim sPath As String
Dim hOut As File
Dim bOnlySources As Boolean
Dim sMsg As String
If Args.Count < 2 Then Usage() $sRoot = System.Path
For iInd = 1 To Args.Max For iInd = 1 To Args.Max
Select Case Args[iInd] Select Case Args[iInd]
Case "-h", "--help" Case "-h", "--help"
Usage() Print File.Load("usage")
Quit
Case "-V", "--version" Case "-V", "--version"
Version() Print Application.Version
Quit
Case "-L", "--license"
Print File.Load("license")
Quit
Case "-v", "--verbose"
$bVerbose = True
Case "-r", "--root"
$sRoot = Args[iInd + 1]
If Not $sRoot Then PrintError(Args[iInd] & " requires an argument")
Inc iInd
Case "-c", "--component"
$sComponent = Args[iInd + 1]
If Not $sComponent Then PrintError(Args[iInd] & " requires an argument")
Inc iInd
Case "--"
bOnlySources = True
Default Default
If Not bOnlySources Then
If Args[iInd] Begins "-" Then
PrintError("unknown option: " & Args[iInd])
Endif
Endif
aSources.Add(Args[iInd]) aSources.Add(Args[iInd])
End Select End Select
Next Next
If aSources.Count = 0 Then aSources.Add(".")
If $sComponent Then
sPath = $sRoot &/ "share/gambas" & System.Version &/ "info" &/ $sComponent & ".help"
PrintMessage("Output to " & sPath)
hOut = Open sPath For Create
Else
hOut = File.Out
Endif
For Each sArg In aSources For Each sArg In aSources
sArg = Application.Dir &/ sArg If Left(sArg) <> "/" Then
If sArg = "." Then
sArg = Application.Dir
Else
sArg = Application.Dir &/ sArg
Endif
Endif
If IsDir(sArg) Then If IsDir(sArg) Then
aRec = RDir(sArg, "*.{c,cpp}") aRec = RDir(sArg, "*.{c,cc,cpp}")
For Each sRec In aRec For Each sRec In aRec
OneFile(sArg &/ sRec) OneFile(sArg &/ sRec, hOut)
Next Next
Else Else
OneFile(sArg) OneFile(sArg, hOut)
Endif Endif
Next Next
If $sComponent Then
Close #hOut
If Stat(sPath).Size = 0 Then
PrintMessage("Removing void data file")
Try Kill sPath
Endif
Endif
Catch
sMsg = Error.Text & ": " & Error.Backtrace.Join(" ")
Output To Default
PrintError(sMsg)
End End
Private Sub Usage() Private Sub OneFile(sPath As String, hOut As File)
Print "Usage:";; Args[0];; "SOURCES..."
Print
Print "Extract Gambas help comments from all SOURCES and output a .help file."
Print "If SOURCES contains directories, they are searched recursively for .c"
Print "and .cpp files."
Print
Print "Options:"
Print "\t-h, --help\t\tDisplay this help text"
Print "\t-V, --version\t\tDisplay project version"
Quit
End
Private Sub Version()
Print Application.Version
Quit
End
Private Sub OneFile(sPath As String)
Dim hFile As File Dim hFile As File
Error "Processing";; sPath; "..." PrintMessage("Processing " & sPath & "...")
hFile = Open sPath For Input hFile = Open sPath For Input
MakeHelp(Translate(Extract(hFile), sPath), File.Out) MakeHelp(Translate(Extract(hFile), sPath), hOut)
Close #hFile Close #hFile
End End
......
MMain
gbh3
0
0
3.6.90
gb.pcre
(c) Tobias Boege, Benoît Minisini
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or
(at your option) any later version.
Extract Gambas help comments from source files.
Usage: gbh3 [options] [<sources>]
Options:
-r --root <root> gives the Gambas installation directory
-c --component <component> generate help directly in a component '*.help' file
-V --version display version
-L --license display license
-h --help display this help
If <sources> contains directories, they are searched recursively for '*.c'
and '*.cpp' files. If <sources> is not specified, the current directory
is searched.
The extracted help is printed on the standard output, unless the '-c'
option is specified.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment