[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Weird behaviour of AM_CONDITIONAL
From: |
Thibaut Le Guilly |
Subject: |
Weird behaviour of AM_CONDITIONAL |
Date: |
Fri, 2 Sep 2011 16:24:51 +0200 |
Hello everybody,
I first hope that I choose the right mailing list to expose my issue, and if
I didn't please excuse my mistake.
I've spent some days working with autotools in order to build a shared
library, and everything went fine except a really weird issue that I have
using AM_CONDITIONAL and the if else statement.
I am using AM_CONDITIONAL to enable a user to choose between one kind of
library and another one with :
AM_CONDITIONAL([ENABLE_A], [test x$condition=xyes])
In my Makefile.am file, I'm using :
if ENABLE_A
lib_la_SOURCES += \
fileA.c\
fileA.h
else
lib_la_SOURCES += \
fileB.c\
fileB.h
endif
My problem is that it always enter in the if statement even when $condition
is equal to 'no'. In fact, I used AC_MSG_RESULT in order to check its value,
but in the generated Makefile, I always find the fileA.c/.h whatever the
value of condition is.
I really tried a lot of stuff, like using two AM_CONDITIONAL like :
AM_CONDITIONAL([ENABLE_A], [test x$condition=xyes])
AM_CONDITIONAL([DISABLE_A], [test x$condition=xno])
with two different if statement (if ENABLE_A and if DISBALE_A), but then
both fileA.c/.h and fileB.c/.h were included in the sources.
Am I doing something wrong? Do you know how to solve this problem?
Thanks in advance to anybody who could help me!
--
Thibaut Le Guilly
- Weird behaviour of AM_CONDITIONAL,
Thibaut Le Guilly <=