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