Projet mkd/Cygwin

De Wiki EELL.

(Différences entre les versions)
m (Version Cygwin Only (beta))
m (version multilingue (en projet))
Ligne 285 : Ligne 285 :
La compilation des sources de la [http://www.eell.fr '''version officielle'''] avec cygwin permet normalement de créer des version multilingues de mkd.exe avec [[wikipedia:fr:GNU_gettext|gettext]].
La compilation des sources de la [http://www.eell.fr '''version officielle'''] avec cygwin permet normalement de créer des version multilingues de mkd.exe avec [[wikipedia:fr:GNU_gettext|gettext]].
 +
 +
Sources gettext [http://gnuwin32.sourceforge.net/packages/libintl.htm libintl]
; Cygwin X86_64  
; Cygwin X86_64  

Version du 3 décembre 2015 à 11:59

Cette page n'est pas finie. Veuillez considérer le plan et le contenu comme incomplets et en préparation, temporaires et sujets à caution. Si vous souhaitez participer, il vous est recommandé de consulter sa page de discussion au préalable.

Retour vers les fichiers en développement

Sommaire

Remarques

_README-Cywin64-2015.txt 
  • Note : Les paquets make et gcc doivent être installés ainsi que le paquet gettext pour la version multilingue
Make mkd.exe version 2015 for cygwin under Windows 10.
------------------------------------------------------

This version 2015 update the release 2013 

version.h :
In english version (mkd_cywin_mkd_only), the Line GETTEXT is commented.
In multilingual version (mkd_cygwin_multilang), the line GETTEXT is uncommented.

Perform mkd.exe only under cygwin :
------------------------------------- 
you can compile this version with the command ./mkd_cygwin_only.bash with the _CYGWIN_cmd (konsole for cygwin)
this version use the normal Makefile with 
//#define GETTEXT ( commented ) in version.h
#define MinGW ( uncommented ) in version.h


Perform mkd.exe under Windows_10 and under cygwin :
---------------------------------------------------- 
you can compile the new version ./mkd_cygwin_windows.bash in the _CYGWIN_cmd (konsole for cygwin)
this version use mkd_cygwin_windows.mak with the gcc windows option -mno-cygwin
 and :
#define version
//#define GETTEXT ( commented ) in version.h
#define MinGW ( uncommented ) in version.h


Perform mkd.exe in multilingual version under cygwin :
-----------------------------------------------------
Compile the new version with the command ./mkd_multilang.bash in the _CYGWIN_cmd (konsole for cygwin)
This version use mkd_multilang.mak with the options :
CFLAGS  = -I/usr/i686-pc-cygwin/sys-root/usr/include 
LDFLAGS = -L/usr/i686-pc-cygwin/sys-root/usr/lib
#define GETTEXT uncommented in version.h
#define MinGW uncommented in version.h

Versions (en)

Version Cygwin Only (beta)

Cette version utilise le Makefile standard pour générer mkd.exe et la doc sous cygwin.

DOC 

Cette version est intéressante car on peut créer une version de tests, non gobale, avec la documentation unix standard :

"make -d install DESTDIR=../tests"

On peut, si on le désire, copier la documentation vers les répertoires cygwin :

cp -Rf ../tests/usr /.
EXE 

mkd_cygwin_only.bash : Recompiler l'exécutable pour le processeur courant (X86 ou X86_64) :

#!/bin/bash

make mkd -d
Makefile 
#!/bin/make
# file: Makefile for packaging mkd on debian or ubuntu sytems
# modified by Jean-Paul Louyot 2012-06-08
# 
# Copyright: ©EELL http://edeulo.free.fr/wiki/index.php/Projet_mkd#LE_DROIT_DE_COPIE:
# for tests type command "make -d install DESTDIR=../tests" for tests
#################
#

BIN   = $(DESTDIR)/usr/bin
CATMANDIR = $(DESTDIR)/var/cache/man
ETC   = $(DESTDIR)/etc
DOC   = $(DESTDIR)/usr/share/doc
ICONS = $(DESTDIR)/usr/share/icons/hicolor
LANG  = $(DESTDIR)/usr/share/locale
MAN   = $(DESTDIR)/usr/share/man
MIME  = $(DESTDIR)/usr/share/mime

PGM	= mkd
SRCS    = mkd.c asm.c basic.c cpp.c fortran.c pascal.c shell.c tri.c
HDRS    = version.h asm.h basic.h cpp.h fortran.h pascal.h shell.h find.inc.h \
          internationalisation.h find.inc.c
OBJS    = mkd.o asm.o cpp.o basic.o fortran.o pascal.o shell.o tri.o
LIBS    =
CFLAGS  =  -O
LDFLAGS =
SPLINTFLAG = -weak


# create bin files:
$(PGM): $(SRCS) $(HDRS) # force recompilation $(SRCS) $(HDRS)
	# rm $(PGM)
	gcc -c $(CFLAGS) $(SRCS) $(LIBS)
	gcc -o $(LDFLAGS) $(PGM) $(OBJS) $(LIBS)
	chmod 755 $(PGM)
	# -@strip $(PGM) # clean ASM and Link reloc

install: $(PGM)
	# create for tests $(DESTDIR) and copy executable in bin directory:
	install -d $(BIN) $(CATMANDIR) $(ETC) $(DOC) $(ICONS) $(LANG) $(MAN) $(MIME)
	install $(PGM) $(BIN)/.
	# install docs:
	#install -d $(DOC)/$(PGM)/html
	#install -m644 doc/*.html $(DOC)/$(PGM)/html/.
	# install icons and update cache: see update in post-install package
	install -d $(ICONS)/256x256/apps $(ICONS)/48x48/apps $(ICONS)/32x32/apps $(ICONS)/16x16/apps
	chmod 644 icons/*
	cp -f icons/mkd-256x256.png $(ICONS)/256x256/apps/mkd.png
	cp -f icons/mkd-48x48.png $(ICONS)/48x48/apps/mkd.png
	cp -f icons/mkd-32x32.png $(ICONS)/32x32/apps/mkd.png
	cp -f icons/mkd-16x16.png $(ICONS)/16x16/apps/mkd.png
	if [ -e "/usr/share/icons/hicolor/16x16/apps/mkd.png" ]; \
		then gtk-update-icon-cache -t /usr/share/icons/hicolor; fi
	# install languages:
	# Installs for tests the local languages, 'de', 'es', 'fr', it, ro, etc.:
	install -d $(LANG)/en/LC_MESSAGES $(LANG)/de/LC_MESSAGES $(LANG)/fr/LC_MESSAGES
	chmod 644 lang/*
	cp -f lang/mkd_en.mo $(LANG)/en/LC_MESSAGES/mkd.mo
	cp -f lang/mkd_fr.mo $(LANG)/fr/LC_MESSAGES/mkd.mo
	# install manuals:
	## install default manual:
	install -D -m644 lang/mkd_en.1.gz $(MAN)/man1/mkd.1.gz
	## install 'de' manual:	
	#if [ -d "/usr/share/man/de.UTF-8/man1" ]; \
	#	then \
	#		install -d $(MAN)/de.UTF-8/man1; \
	#		cp -f lang/mkd_de.1.gz $(MAN)/de.UTF-8/man1/mkd.1.gz; \
	#	elif [ -d "$(MAN)/de/" ]; \
	#		then \
	#			install -d $(MAN)/de/man1; \
	#			cp -f lang/mkd_de.1.gz $(MAN)/de/man1/mkd.1.gz; \
	#fi
	## install 'fr' manual:
	if [ -d "/usr/share/man/fr.UTF-8/man1" ]; \
		then \
			install -d $(MAN)/fr.UTF-8/man1;\
			cp -f  lang/mkd_fr.1.gz $(MAN)/fr.UTF-8/man1/mkd.1.gz; \
		elif [ -d "/usr/share/man/fr/" ]; \
			then \
				install -d $(MAN)/fr/man1; \
				cp -f lang/mkd_fr.1.gz $(MAN)/fr/man1/mkd.1.gz ; \
	fi
	# install catman only if selected manuals exist:
	if [ -e $(MAN)"/man1" ]; then catman -M $(MAN)/man1/mkd.1.gz; fi
	if [ -e $(MAN)"/de.UTF-8/man1/mkd.1.gz" ]; then catman -M $(MAN)/de.UTF-8/man1/mkd.1.gz; fi
	if [ -e $(MAN)"/de/man1/mkd.1.gz" ]; then catman -M $(MAN)/de/man1/mkd.1.gz ; fi
	if [ -e $(MAN)"/fr.UTF-8/man1/mkd.1.gz" ]; then catman -M $(MAN)/fr.UTF-8/man1/mkd.1.gz; fi
	if [ -e $(MAN)"/fr/man1/mkd.1.gz" ]; then catman -M $(MAN)/fr/man1/mkd.1.gz ; fi
	# install and update MIME database: see update in post-install package
	install -D -m644  mkd.xml $(MIME)/packages/mkd.xml
	if [-e "/usr/share/mime/packages/mkd.xml" ]; then update-mime-database /usr/share/mime/; fi

# create man only in programmers source file; not for packaging if mkd is not installed
# else type command "make -d mkd.1" to create modified file "manuals"
mkd.1: manuals
	if [ -e "/usr/bin/mkd" ]; \
	then \
		mkd -Ct F manuals mkd.1; \
		gzip -c mkd.1 > mkd_fr.1.gz; \
		mkd -Ctw M manuals mkd.1; \
		gzip -c mkd.1 > mkd_en.1.gz; \
		rm mkd.1; \
	fi
	
clean:
	# rm *.o
	# rm *~

Version Windows + Cygwin (alpha for tests)

Cette version est moins intéressante que la version compilée avec MinGW

mkd_cygwin_windows.bash 
#!/bin/bash
# file: mkd_cygwin_windows.bash for cygwin64 5 Nov 2015
make -f mkd_cygwin_windows.mak 
make -f mkd_cygwin_windows.mak clean 
make -f mkd_cygwin_windows.mak copydoc
mkd_cygwin_windows.mak 
# file: mkd_cygwin_windows.mak 
# (Makefile pour cygwin et windows_10, mkd.exe version 151105)
# problem with obsolete option -mno-cygwin
#
# terminal command : 
# make -f mkd_cygwin_windows.mak
# make -f mkd_cygwin_windows.mak clean
# make -f mkd_cygwin_windows.mak copydoc
#
# create nov 5,2015 by JPL for cygwin64
# amended November 6,2015 by Clara
# modified ... by ... for
# 
# Attention: avant de compiler, il faut valider les options de compilation
# dans version.h (notamment version UNIX ou version PC MinGW ainsi que la version multilangue avec GETTEXT)
#
# i386 and x86-64 Windows Options :
# -mconsole -mcygwin -mno-cygwin -mdll -mnop-fun-dllimport
# -mthread -municode -mwin32 -mwindows
# -fno-set-stack-executable
#
######################################

PGM     = mkd.exe
CC      = cc
BINDIR  = /usr/bin
DOCDIR  = /usr/share/doc
BINMODE = 755

SRCS    = mkd.c asm.c basic.c cpp.c fortran.c pascal.c shell.c tri.c
HDRS    = version.h mkd.h asm.h basic.h cpp.h fortran.h pascal.h shell.c \
find.inc.c find.inc.h tri.h
OBJS    = mkd.o asm.o basic.o cpp.o fortran.o pascal.o shell.o tri.o
LIBS    =
CFLAGS  = -mwindows -m64 
# -mno-cygwin
LDFLAGS = -mwindows -m64 
# -mno-cygwin
SPLINTFLAG = 

#install: $(BINDIR)/$(PGM) # $(MANUALS) 

$(BINDIR)/$(PGM): $(SRCS) $(HDRS)
	-@echo "*********** update $(PGM) :"
	$(CC) $(CFLAGS) $(SRCS) -c
#	$(CC) $(CFLAGS) -o $(PGM) $(SRCS) -c
	$(CC) $(LDFLAGS) -o $(PGM) $(OBJS) $(LIBS)
	# clean ASM and LINK reloc :
	-@strip $(PGM) 	
  #
	-@echo "***********  update $(BINDIR)/mkd.exe:" 		
	# install PGM in BINDIR
	-@if [ -d $(BINDIR) ]; then \
		chmod $(BINMODE) $(PGM); \
		cp -f $(PGM) $(BINDIR)/$(PGM); \
		#if [ $(BINDIR) != "/bin" ]; then \
		#rm -f /bin/$(PGM); \
		#ln -s $(BINDIR)/$(PGM) /bin/$(PGM); \
		#fi \
	else \
		echo "couldn't find $(BINDIR)";\
	fi
  #
  
copydoc:
	-@echo "***********  update $(DOCDIR)/mkd:"
	-@if [ -d $(DOCDIR) ]; then \
		if [ ! -d $(DOCDIR)/mkd ]; then \
			mkdir $(DOCDIR)/mkd; \
			cp -rf doc/* $(DOCDIR)/mkd/.; \
		#fi \
		else if [ -d $(DOCDIR)/mkd ]; then \
			cp -rf doc/* $(DOCDIR)/mkd/.; \
			fi \
		fi \
	else \
		echo "couldn't find $(DOCDIR)"; \
	fi  

clean:
	rm -f $(OBJS)

version multilingue (en projet)

Note : Les paquets make, gcc et gettext doivent être installés

La compilation des sources de la version officielle avec cygwin permet normalement de créer des version multilingues de mkd.exe avec gettext.

Sources gettext libintl

Cygwin X86_64

Ce projet à l'étude en fin 2015 n'a pas abouti faute de librairies associées à gettext dans la version cygwin X86_64.

Cygwin X86

Cette version n'a pas été évaluée en fin 2015

Il semble que ces libraires soient présentes dans la version i686.

Sous versions 32 bits X86 il faut dé-commenter gettext dans version.h et de mettre à jour le numéro de version
Outils personnels