Issue 8787 - mkdep does not get CFLAGS during cross compilation
Summary: mkdep does not get CFLAGS during cross compilation
Status: VERIFIED WORKSFORME
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: 2.5.0
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-08 23:08 UTC by jinxinliang@yahoo.com
Modified: 2020-04-19 19:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jinxinliang@yahoo.com 2017-12-08 23:08:06 UTC
Full_Name: Jeremy Jin
Version: 2.4
OS: mingw and ubuntu
URL: 
Submission from: (NULL) (209.29.4.43)


I am trying to build mingw in two different situations,

1. on mingw 
2. cross build from ubuntu 14 for target arm linux

In both situation I found that, some dependencies (such as regex) does not exist
in system default /usr/include. So I download regex from somewhere and build it.
Then I need to specify a custom CFLAGS for configure command such as below

./configure CFLAGS=-I/home/user1/include LDFLAGS=-L/home/user1/lib LIBS=-lregex


the configuration run successfully,then I proceed to do "make depend". However
it will report "regex.h" file not found. And I found that "mkdep" command does
not make use of the CFLAGS I provided on configure command at all. I worked
around it by create another mkdep command to wrap the existing mkdep command and
add my additional include folders and it worked.

Then next issue I found is I had to modify "portable.h" file as well. I had to
comment out  "#define socklen_t int" and add "typedef unsigned int uint32_t". I
am not sure why the portable.h is not generated correctly (this only happens on
mingw, not tested on ubuntu cross compiling ARM at all). 

Comment 1 Ryan Tandy 2020-04-19 19:00:06 UTC
(In reply to jinxinliang@yahoo.com from comment #0)
> the configuration run successfully,then I proceed to do "make depend". However
> it will report "regex.h" file not found. And I found that "mkdep" command does
> not make use of the CFLAGS I provided on configure command at all.

-I<dir> should be placed in CPPFLAGS, not CFLAGS. This works fine, CPPFLAGS are correctly passed through to mkdep.

> Then next issue I found is I had to modify "portable.h" file as well. I had to
> comment out  "#define socklen_t int" and add "typedef unsigned int uint32_t".

These are bug 7878 and bug 8383 and have both been fixed for 2.4.50.