Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zconf: fixed yacc/lex prefix #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zack-vii
Copy link

No description provided.

@zack-vii zack-vii force-pushed the master branch 3 times, most recently from af31542 to 4188500 Compare August 3, 2020 16:32
Copy link
Owner

@AndreaRigoni AndreaRigoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Timo, sorry for the delay...
Great !! thanks for your fixes.

I would ask you to make a small change on this if you can.
if you are not using the variable in the makefile do not use AM_CONDITIONAL and use AS_IF instead.
AM_CONDITIONAL defines two more variables in Makefile that I would not add if they are not required.

If you prefer I could merge this now and then change it back to use AS_IF ..

Thanks again !!

Andrea

@zack-vii
Copy link
Author

Ah yea well my automake skills are minimal so i copied from here and there to get the effect i wanted.. fell free to clean it up.. but i would not know what to replace without risking a lost of functionality .. i assume AM_IF combined AM_COND_IF and AM_CONDITION without the generation nthe intermediate objects, ie. the CONDITION ?

@AndreaRigoni
Copy link
Owner

AndreaRigoni commented Sep 10, 2020

As far as I know .. ( noone is really skilled in Automake stuff :-) the AM_CONDITIONAL add two magic variables to Makefile.in from Makefile.am.

Example:
AM_CONDITIONAL([TIMO],[ test x${USER} = xTimo ])
(if the user is Timo ) adds:
ENABLE_TIMO_TRUE =
ENABLE_TIMO_FALSE = #
( if the user is not Timo ) adds:
ENABLE_TIMO_TRUE = #
ENABLE_TIMO_FALSE =

This is not the actual variable TIMO though ... you can define it with
AS_VAR_SET([TIMO], [Timo S.])
and then use
AC_SUBST([TIMO])
to have it in the Makefile

and the if condition in Makefile.am ( that is not present in regular Makefiles ) is replaced like this:

hello:
if TIMO
echo "Hello $(TIMO) !"
else
echo "Hello stranger !"
endif

is replaced with

hello:
@ENABLE_TIMO_TRUE@ echo "Hello $(TIMO) !"
@ENABLE_TIMO_FALSE@ echo "Hello stranger !"

Nice Automake trick to ease writing Makefile but make it hard to learn :-)

The AM_COND_IF is there to make you able to use the defined condition also during configuration..

on the other hand the AS_IF is simply replaced with a if clause in the configure script

AS_IF([test x${USER} = "Timo"],
[echo "you are configuring stuff as Timo"],
[echo "Who are you ... what are you doing with my code !"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants