xref: /haiku/src/build/libsolv/Jamfile (revision 12dba4e70f831d6d27a7f769cc9dab19c19a155d)
1SubDir HAIKU_TOP src build libsolv ;
2
3local libsolvSourceBaseDirectory
4	= [ BuildFeatureAttribute libsolv : sources : path ] ;
5local libsolvSourceDirectory = [ FDirName $(libsolvSourceBaseDirectory) src ] ;
6local libsolvextSourceDirectory
7	= [ FDirName $(libsolvSourceBaseDirectory) ext ] ;
8
9local libsolvMajor = 0 ;
10local libsolvMinor = 3 ;
11local libsolvPatch = 0 ;
12local libsolvVersion = $(libsolvMajor).$(libsolvMinor).$(libsolvPatch) ;
13
14DEFINES =
15	LIBSOLV_INTERNAL
16	HAIKU
17	ENABLE_HAIKU
18	VERSION=\\\"$(libsolvVersion)\\\"
19	_GNU_SOURCE
20	;
21
22# One of the following must be defined:
23# * HAVE_FUNOPEN / HAVE_FOPENCOOKIE
24#
25# One of the following can be defined:
26# * HAVE_QSORT_R / HAVE___QSORT ?
27switch $(HOST_PLATFORM) {
28	case linux :
29		DEFINES += HAVE_STRCHRNUL HAVE_QSORT_R HAVE_FOPENCOOKIE ;
30	case haiku_host :
31		DEFINES += HAVE_STRCHRNUL HAVE_FOPENCOOKIE ;
32	case freebsd :
33		DEFINES += HAVE_STRCHRNUL HAVE_FUNOPEN ;
34	case darwin :
35		DEFINES += HAVE_FUNOPEN HAVE_QSORT_R ;
36	case mingw :
37		DEFINES += ;
38	case * :
39		Exit $(SUBDIR)/Jamfile: "Please add a case for your platform"
40			"($(HOST_PLATFORM))!" ;
41}
42
43SubDirCcFlags -Wno-sign-compare -Wno-missing-prototypes ;
44
45
46# libsolv
47
48UseHeaders $(libsolvSourceDirectory) ;
49
50local libsolvSources = [ FGristFiles
51	bitmap.c poolarch.c poolvendor.c poolid.c strpool.c dirpool.c
52	solver.c solverdebug.c repo_solv.c repo_write.c evr.c pool.c
53	queue.c repo.c repodata.c repopage.c util.c policy.c solvable.c
54	transaction.c rules.c problems.c
55	chksum.c md5.c sha1.c sha2.c solvversion.c selection.c
56	] ;
57
58LOCATE on $(libsolvSources) = $(libsolvSourceDirectory) ;
59Depends $(libsolvSources) : [ BuildFeatureAttribute libsolv : sources ] ;
60
61MakeLocate libsolv_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ;
62
63BuildPlatformSharedLibrary libsolv_build.so
64	:
65	$(libsolvSources)
66	;
67
68# libsolvext
69
70UseHeaders $(libsolvextSourceDirectory) ;
71
72local libsolvextSources = [ FGristFiles
73	solv_xfopen.c testcase.c
74	repo_haiku.cpp
75	] ;
76
77LOCATE on $(libsolvextSources) = $(libsolvextSourceDirectory) ;
78Depends $(libsolvextSources) : [ BuildFeatureAttribute libsolv : sources ] ;
79
80USES_BE_API on libsolvext_build.so = true ;
81
82MakeLocate libsolvext_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ;
83
84BuildPlatformSharedLibrary libsolvext_build.so
85	:
86	$(libsolvextSources)
87	:
88	libsolv_build.so
89	libpackage_build.so
90	z
91	;
92
93
94# generate solvversion.h
95
96actions GenerateLibsolvVersionHeader
97{
98	sed -e s,@VERSION@,$(LIBSOLV_VERSION),g \
99		-e s,@LIBSOLV_MAJOR@,$(LIBSOLV_MAJOR),g \
100		-e s,@LIBSOLV_MINOR@,$(LIBSOLV_MINOR),g \
101		-e s,@LIBSOLV_PATCH@,$(LIBSOLV_PATCH),g \
102		$(2) > $(1)
103}
104
105local versionHeaderIn = solvversion.h.in ;
106LOCATE on $(versionHeaderIn) = $(libsolvSourceDirectory) ;
107Depends $(versionHeaderIn) : [ BuildFeatureAttribute libsolv : sources ] ;
108
109local versionHeader = [ FGristFiles solvversion.h ] ;
110MakeLocate $(versionHeader) : $(LOCATE_SOURCE) ;
111Depends $(versionHeader) : $(versionHeaderIn) ;
112LIBSOLV_VERSION on $(versionHeader) = $(libsolvVersion) ;
113LIBSOLV_MAJOR on $(versionHeader) = $(libsolvMajor) ;
114LIBSOLV_MINOR on $(versionHeader) = $(libsolvMinor) ;
115LIBSOLV_PATCH on $(versionHeader) = $(libsolvPatch) ;
116GenerateLibsolvVersionHeader $(versionHeader) : $(versionHeaderIn) ;
117
118Includes $(libsolvSources) $(libsolvextSources) : $(versionHeader) ;
119