Ralf S. Engelschall 24 лет назад
Родитель
Сommit
bfaa625391
1 измененных файлов с 29 добавлено и 8 удалено
  1. 29 8
      sqlite/sqlite.spec

+ 29 - 8
sqlite/sqlite.spec

@@ -27,8 +27,11 @@
 %ifndef       with_utf8
 %define       with_utf8            no
 %endif
-%ifndef       with_ndebug
-%define       with_ndebug          yes
+%ifndef       with_assert
+%define       with_assert          no
+%endif
+%ifndef       with_readline
+%define       with_readline        no
 %endif
 
 #   package information
@@ -51,6 +54,9 @@ Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
 BuildPreReq:  OpenPKG, openpkg >= 20020206
 PreReq:       OpenPKG, openpkg >= 20020206
+%if "%{with_readline}" == "yes"
+BuildPreReq:  readline
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -65,17 +71,32 @@ AutoReqProv:  no
     the server. The SQLite library reads and writes directly to and from
     the database files on disk.
 
-    Options: with_utf8=%{with_utf8} with_ndebug=%{with_ndebug}
+    Options: with_utf8=%{with_utf8} 
+    Options: with_assert=%{with_assert}
+    Options: with_readline=%{with_readline}
 
 %prep
     %setup -q -n sqlite
 
 %build
-    CC="%{l_cc}" \
-%if "%{with_utf8}" == "yes"
-    CFLAGS="%{l_cflags -O}" \
-%else
-    CFLAGS="%{l_cflags -O} -DNDEBUG=1" \
+    CC="%{l_cc}"
+    export CC
+    CPPFLAGS=""
+    export CPPFLAGS
+    CFLAGS="%{l_cflags -O}"
+    export CFLAGS
+    LDFLAGS=""
+    export LDFLAGS
+    LIBS=""
+    export LIBS
+%if "%{with_assert}" == "no"
+    CFLAGS="$CFLAGS -DNDEBUG=1"
+%endif
+%if "%{with_readline}" == "yes"
+    CPPFLAGS="$CPPFLAGS -I%{l_prefix}/include -I%{l_prefix}/include/readline"
+    CFLAGS="$CFLAGS -I%{l_prefix}/include -I%{l_prefix}/include/readline"
+    LDFLAGS="$LDFLAGS -L%{l_prefix}/lib"
+    LIBS="$LIBS -lreadline -ltermcap"
 %endif
     ./configure \
         --prefix=%{l_prefix} \