la question est de savoir comment mettre ca dans ton programme C, le
truc de configure n'est qu'un probleme on top je dirais. Pour se faire,
le plus simple est d'utiliser un define definis a la compilation; genre
blah.c:
foo(int bar) {
unsigned char *p = BASE_CONFIG;
// p = "/etc/foo"
}
et compiler comme
cc blah.c -DBASE_CONFIG="/etc/foo"
finalement, dans ton configure, utilise les variables pour les passer
dans ton makefile.. et wala le tour est joue.
JeF
On Thu, 2003-09-18 at 14:44, Fabian Vilers wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Bonjour � tous,
>
> Je souhaiterais am�liorer mon approche de la programmation sous Linux.
> Jusqu'ici, lorsque je lisais/�crivais un fichier, je connaissais son
> chemin soit parce que je l'avais hardcod� dans le source, soit parce
> j'avais un fichier de configuration � un endroit bien pr�cis, soit dans
> un database,...
>
> J'aimerais pouvoir utiliser les arguments pass�s � ./configure (comme
> - --prefix, ou --sysconfidir). Seulement, je n'ai pas la moindre id�e de
> comment. Si l'utilisateur sp�cifie qu'il veut les fichiers de
> configuration aileurs que dans /etc/project_abc; comment puis-je lire
> dans mon projet les fichiers?
>
> Si l'un d'entre vous aurait un ou quelques liens vers des how-to...
>
> Merci d'avance,
> Fabian
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQE/aajA3Qzx239StfYRAr/xAJ0evW5rdBheqi18VKSWDwp3BOWUBQCeJ/9b
> BKP+vRSmb9YdaMvmVMaOBhw=
> =47Jv
> -----END PGP SIGNATURE-----
> --
> The information contained in this electronic message may be legally
> privileged and confidential under applicable law, and is intended only for
> the use of the individual or entity named above. If the recipient of this
> message is not the above-named intended recipient, you are hereby notified
> that any dissemination, copy or disclosure of this communication is strictly
> prohibited. If you have received this communication in error, please notify
> Keyware, +32 2 346 25 23 and purge the communication immediately without
> making any copy or distribution.
>
> _______________________________________________________
> Linux Mailing List - http://www.unixtech.be
> Subscribe/Unsubscribe: http://www.unixtech.be/mailman/listinfo/linux
> Archives: http://www.mail-archive.com/[EMAIL PROTECTED]
> IRC: efnet.unixtech.be:6667 - #unixtech
--
-> Jean-Francois Dive
--> [EMAIL PROTECTED]
I think that God in creating Man somewhat overestimated his ability.
-- Oscar Wilde
_______________________________________________________
Linux Mailing List - http://www.unixtech.be
Subscribe/Unsubscribe: http://www.unixtech.be/mailman/listinfo/linux
Archives: http://www.mail-archive.com/[EMAIL PROTECTED]
IRC: efnet.unixtech.be:6667 - #unixtech