more small build tweaks. use mkdtemp if available

This commit is contained in:
dockes 2005-10-21 08:14:42 +00:00
parent ab0f3110c0
commit be12ed95ce
7 changed files with 22 additions and 9 deletions

View File

@ -13,4 +13,4 @@ clean:
cd qtgui; rm -f recoll; $(MAKE) clean
cd query; $(MAKE) clean
cd utils; $(MAKE) clean
rm -rf qtgui/Makefile qtgui/preview/Makefile

View File

@ -1 +1 @@
1.01
1.02

View File

@ -19,3 +19,6 @@ excludefile
makedist.sh
mk/sysconf
qtgui/Makefile
qtgui/preview/Makefile
qtgui/preview/preview.pro
qtgui/preview/pvmain.cpp

View File

@ -2,7 +2,8 @@ CXXFLAGS = -pthread -Wall -Wno-unused-variable -g \
-I. -I../index -I../utils -I../common \
-I../unac -I../bincimapmime -I/usr/local/include \
\
-DHAVE_VASPRINTF=1
-DHAVE_VASPRINTF=1 \
-DHAVE_MKDTEMP=1
LIBXAPIAN = -L/usr/local/lib -lxapian
LIBICONV = -L/usr/local/lib -liconv

View File

@ -1,7 +1,8 @@
CXXFLAGS = -Wall -g -I. -I../index -I../utils -I../common \
-I../unac -I../bincimapmime -I/usr/local/include \
\
-DHAVE_VASPRINTF=1 -D_GNU_SOURCE
-D_GNU_SOURCE \
-DHAVE_VASPRINTF=1 \
-DHAVE_MKDTEMP=1
LIBXAPIAN = -L/usr/local/lib -lxapian
LIBICONV =

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: pvmain.cpp,v 1.3 2005-10-17 13:36:53 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: pvmain.cpp,v 1.4 2005-10-21 08:14:42 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
#include <stdio.h>
@ -51,6 +51,9 @@ int main( int argc, char ** argv )
newEd->setText(str);
w.pvTab->addTab(anon, "Tab 2");
#if QT_VERSION < 0x040000
a.setMainWidget(&w);
#endif
w.show();
return a.exec();
}

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.5 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.6 2005-10-21 08:14:42 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#ifndef TEST_SMALLUT
#include <string>
@ -33,8 +33,12 @@ bool maketmpdir(string& tdir)
LOGERR(("maketmpdir: out of memory (for file name !)\n"));
tdir.erase();
return false;
}
}
#ifdef HAVE_MKDTEMP
if (!mkdtemp(cp)) {
#else
if (!mktemp(cp)) {
#endif // HAVE_MKDTEMP
free(cp);
LOGERR(("maketmpdir: mktemp failed\n"));
tdir.erase();
@ -43,12 +47,13 @@ bool maketmpdir(string& tdir)
tdir = cp;
free(cp);
}
#ifndef HAVE_MKDTEMP
if (mkdir(tdir.c_str(), 0700) < 0) {
LOGERR(("maketmpdir: mkdir %s failed\n", tdir.c_str()));
tdir.erase();
return false;
}
#endif
return true;
}