[Slackbuilds-users] how can i define data_dir in makefile?
Gabriel Diaz
gdiaz at qswarm.com
Tue Aug 21 18:21:21 UTC 2018
hello
in the source code of icsim.c there is a
#ifndef DATA_DIR
#define DATA_DIR "./data/" // Needs trailing slash
#endif
and then
if(stat(DATA_DIR, &dirstat) == -1) {
printf("ERROR: DATA_DIR not found. Define in make file or run in src dir\n");
exit(34);
}
so if there is no DATA_DIR defined, you might try to create a "data" diretory on the same path you´re running icsim.
another option is to add -DDATA_DIR=/var/lib/iscsim or something like that to the CFLAGS so the DATA_DIR is defined to your liking.
probably a good option is to define -DDATA_DIR in the CFLAGS and instruct the buildscript to define a DATA_DIR variable by default or pick one from the environment.
my 2 cents.
gabi
Sent with ProtonMail Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On 21 August 2018 8:06 PM, Fernando Lopez <fernando.lopezjr at gmail.com> wrote:
> not working... not working =\
>
> On Tue, Aug 21, 2018 at 11:44 AM David Woodfall <dave at dawoodfall.net> wrote:
>
> > On Tuesday 21 August 2018 18:37,
> > Dave Woodfall <dave at dawoodfall.net> put forth the proposition:
> > > On Tuesday 21 August 2018 11:33,
> > > Fernando Lopez <fernando.lopezjr at gmail.com> put forth the proposition:
> > > > didnt work. =\
> > >
> > > You could try:
> > >
> > > export DATA_DIR=bla
> > >
> > > But it does say to put it in the make file, so maybe you'll have to
> > > sed it in or make a patch.
> >
> > By the way, CFLAGS="$SLKCFLAGS" \ ought to be before the make command
> > anyway.
> >
> > -Dave
> >
> > > -Dave
> > >
> > > Well it does say to put it in the makefile
> > > > On Tue, Aug 21, 2018 at 11:31 AM David Woodfall <dave at dawoodfall.net> wrote:
> > > >
> > > > > On Tuesday 21 August 2018 11:29,
> > > > > Fernando Lopez <fernando.lopezjr at gmail.com> put forth the proposition:
> > > > > > this is the error i get when i run my program...
> > > > > > *"ERROR: DATA_DIR not found. Define in make file or run in src dir"*
> > > > > >
> > > > > > this is how i am doing it:
> > > > > >
> > > > > > make \
> > > > > > CFLAGS="$SLKCFLAGS" \
> > > > > > DATA_DIR=$PKG/usr/share/icsim
> > > > >
> > > > > Try putting in front of make or exporting it:
> > > > >
> > > > > DATA_DIR=bla \
> > > > > CFLAGS="$SLKCFLAGS" \
> > > > > make
> >
> > --
> >
> > One of the things that hamper Linux's climb to world domination is the
> > shortage of bad Computer Role Playing Games, or CRaPGs. No operating system
> > can be considered respectable without one.
> > -- Brian O'Donnell, odonnllb at tcd.ie
> >
> > .--. oo
> > (____)//
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
> > _______________________________________________
> > SlackBuilds-users mailing list
> > SlackBuilds-users at slackbuilds.org
> > https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> > Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> > FAQ - https://slackbuilds.org/faq/
>
> --
>
> ------------
> Regards,
> Fernando Lopez Jr.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 855 bytes
Desc: OpenPGP digital signature
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20180821/4bbf0986/attachment.asc>
More information about the SlackBuilds-users
mailing list