Skip to content

Commit

Permalink
config.h for libraries
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.code.sf.net/p/rts-2/code/trunk/rts-2@10839 65ab8f4e-f147-0410-b3a9-f14133ecfe55
  • Loading branch information
pkubanek committed Sep 11, 2012
1 parent 4914945 commit 8d7eb4b
Show file tree
Hide file tree
Showing 112 changed files with 474 additions and 466 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2012-09-10
* moved config.h from include into ../, create prefixed version with AX_PREFIX_CONFIG_H

2012-09-09
* night_next command, allows darks in queue

Expand Down
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ SUBDIRS = include \
EXTRA_DIST = autogen.sh RUN rts2.initd.in \
INSTALL INSTALL.alta INSTALL.fli INSTALL.paramount INSTALL.andor \
INSTALL.comedi INSTALL.miccd INSTALL.sbig INSTALL.gpib rts2-init

noinst_HEADERS = config.h
8 changes: 4 additions & 4 deletions include/config.h.in → config.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* include/config.h.in. Generated from configure.ac by autoheader. */
/* config.h.in. Generated from configure.ac by autoheader. */

/* If ARC version 1.7 is used */
#undef ARC_API_1_7
Expand Down Expand Up @@ -319,12 +319,12 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION

/* prefix */
#undef PREFIX

/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE

/* prefix */
#undef RTS2_PREFIX

/* Define to the type of arg 1 for `select'. */
#undef SELECT_TYPE_ARG1

Expand Down
11 changes: 6 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ AC_SUBST(INC_BIGNG)

# Define prefix variable

AH_TEMPLATE([RTS2_PREFIX],[prefix])
AH_TEMPLATE([PREFIX],[prefix])
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(RTS2_PREFIX, "", [prefix])
AC_DEFINE_UNQUOTED(PREFIX, "", [prefix])
else
AC_DEFINE_UNQUOTED(RTS2_PREFIX, "$prefix", [prefix])
AC_DEFINE_UNQUOTED(PREFIX, "$prefix", [prefix])
fi
AC_SUBST(RTS2_PREFIX)
AC_SUBST(PREFIX)

# Define lock file prefix
AC_ARG_WITH(lock,
Expand Down Expand Up @@ -790,7 +790,8 @@ AM_CONDITIONAL(HAVE_DB2MAN, test x$DB2MAN != xno)
AM_CONDITIONAL(HAVE_DB2FOP, test x$DB2FOP != xno)

AC_CONFIG_SRCDIR(src)
AC_CONFIG_HEADER(include/config.h)
AM_CONFIG_HEADER(config.h)
AX_PREFIX_CONFIG_H(include/rts2-config.h)

AM_CONDITIONAL(NOT_GETADDRINFO, test x${ac_cv_func_getaddrinfo} = xno)
AM_CONDITIONAL(NOT_GETOPT_LONG, test x${ac_cv_func_getopt_long} = xno)
Expand Down
2 changes: 1 addition & 1 deletion include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

SUBDIRS = connection rts2db rts2script rts2fits rts2scheduler vermes

noinst_HEADERS = rts2.h config.h imghdr.h status.h telescope_info.h imgdisplay.h connection.h logstream.h \
noinst_HEADERS = rts2.h imghdr.h status.h telescope_info.h imgdisplay.h connection.h logstream.h \
message.h strtok.h xmlerror.h teld.h camd.h dome.h cupola.h sensord.h focusd.h filterd.h phot.h rotad.h \
mirror.h block.h daemon.h device.h multidev.h scriptdevice.h devclient.h command.h event.h objectcheck.h \
hoststring.h utilsfunc.h app.h getopt_own.h option.h getaddrinfo.h networkaddress.h connuser.h value.h valuestat.h valuelist.h valuearray.h \
Expand Down
2 changes: 1 addition & 1 deletion include/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <sstream>

#ifdef HAVE_SYS_INOTIFY_H
#ifdef RTS2_HAVE_SYS_INOTIFY_H
#include <sys/inotify.h>
#endif

Expand Down
6 changes: 3 additions & 3 deletions include/connnotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#ifndef __RTS2_CONNNOTIFY__
#define __RTS2_CONNNOTIFY__

#include "config.h"
#include "rts2-config.h"

#include "connnosend.h"

#ifdef HAVE_SYS_INOTIFY_H
#ifdef RTS2_HAVE_SYS_INOTIFY_H
#include <sys/inotify.h>
#endif

Expand Down Expand Up @@ -74,7 +74,7 @@ class ConnNotify:public ConnNoSend

bool getDebug () { return debug; }

#ifdef HAVE_SYS_INOTIFY_H
#ifdef RTS2_HAVE_SYS_INOTIFY_H
int addWatch (const char *filename, uint32_t mask = IN_MODIFY);
#else
int addWatch (const char *filename, uint32_t mask = 0);
Expand Down
4 changes: 2 additions & 2 deletions include/getaddrinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define GETADDRINFO_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#include "rts2-config.h"
#endif

#include <sys/types.h>
Expand Down Expand Up @@ -131,7 +131,7 @@
* Fake struct and function names.
* <netdb.h> might declares all or some of them.
*/
#if defined(HAVE_GETADDRINFO) || defined(HAVE_GETNAMEINFO)
#if defined(RTS2_HAVE_GETADDRINFO) || defined(RTS2_HAVE_GETNAMEINFO)
#define addrinfo my_addrinfo
#define gai_strerror my_gai_strerror
#define freeaddrinfo my_freeaddrinfo
Expand Down
4 changes: 2 additions & 2 deletions include/nan.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#ifndef __RTS2_NAN__
#define __RTS2_NAN__

#include <config.h>
#include <rts2-config.h>

#ifndef HAVE_ISINF
#ifndef RTS2_HAVE_ISINF
#include <ieeefp.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/networkaddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#include <string.h>

#include "status.h"
#include <config.h>
#include <rts2-config.h>

// CYGWIN workaround
#ifndef HAVE_GETADDRINFO
#ifndef RTS2_HAVE_GETADDRINFO
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
Expand Down
4 changes: 2 additions & 2 deletions include/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#ifndef __RTS2_OPTION__
#define __RTS2_OPTION__

#include "config.h"
#include "rts2-config.h"

#ifdef HAVE_GETOPT_LONG
#ifdef RTS2_HAVE_GETOPT_LONG
#include <getopt.h>
#else
#include "getopt_own.h"
Expand Down
10 changes: 5 additions & 5 deletions include/rts2fits/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <list>
#include <ostream>
#include <vector>
#include <config.h>
#include <rts2-config.h>
#include <fitsio.h>

#include "imghdr.h"
Expand All @@ -38,12 +38,12 @@

#define NUM_WCS_VALUES 7

#if defined(HAVE_LIBJPEG) && HAVE_LIBJPEG == 1
#if defined(RTS2_HAVE_LIBJPEG) && RTS2_HAVE_LIBJPEG == 1
#include <Magick++.h>
#endif // HAVE_LIBJPEG

// TODO remove this once Libnova 0.13.0 becomes mainstream
#if !HAVE_DECL_LN_GET_HELIOCENTRIC_TIME_DIFF
#if !RTS2_HAVE_DECL_LN_GET_HELIOCENTRIC_TIME_DIFF
double ln_get_heliocentric_time_diff (double JD, struct ln_equ_posn *object);
#endif

Expand Down Expand Up @@ -282,7 +282,7 @@ class Image:public FitsFile

void getChannelGrayscaleImage (int _dataType, int chan, unsigned char * &buf, float quantiles, size_t offset);

#if defined(HAVE_LIBJPEG) && HAVE_LIBJPEG == 1
#if defined(RTS2_HAVE_LIBJPEG) && RTS2_HAVE_LIBJPEG == 1
/**
* Return image data as Magick::Image class.
*
Expand Down Expand Up @@ -589,7 +589,7 @@ class Image:public FitsFile
void setObserver ()
{
if (writeRTS2Values)
setValue ("OBSERVER", "RTS2 " VERSION, "observer");
setValue ("OBSERVER", "RTS2 " RTS2_VERSION, "observer");
}

void setOrigin (const char *orig)
Expand Down
4 changes: 2 additions & 2 deletions include/rts2script/connimgprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ConnProcess:public rts2script::ConnExe

double getExposureEnd () { return expDate; };

#ifdef HAVE_LIBJPEG
#ifdef RTS2_HAVE_LIBJPEG
void setLastGoodJpeg (const char *_last_good_jpeg) { last_good_jpeg = _last_good_jpeg; }
void setLastTrashJpeg (const char *_last_trash_jpeg) { last_trash_jpeg = _last_trash_jpeg; }
#endif
Expand All @@ -50,7 +50,7 @@ class ConnProcess:public rts2script::ConnExe
astrometry_stat_t astrometryStat;
double expDate;

#ifdef HAVE_LIBJPEG
#ifdef RTS2_HAVE_LIBJPEG
const char *last_good_jpeg;
const char *last_trash_jpeg;
#endif
Expand Down
12 changes: 6 additions & 6 deletions include/utilsfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
#include <stdlib.h>
#include <string.h>

#include "config.h"
#include "rts2-config.h"
#include "nan.h"
#include <math.h>

#ifndef HAVE_ISINF
#ifndef RTS2_HAVE_ISINF
#include <ieeefp.h>
#endif

Expand Down Expand Up @@ -146,7 +146,7 @@ template < typename T > void fillIn (char **p, T val)
/**
* Replacement for isinf - on Solaris platform
*/
#ifndef HAVE_ISINF
#ifndef RTS2_HAVE_ISINF
int isinf(double x);
#endif

Expand Down Expand Up @@ -239,11 +239,11 @@ int isfinite(double x);
} while (0)
#endif

#ifndef HAVE_ISBLANK
#ifndef RTS2_HAVE_ISBLANK
#define isblank(x) (isspace(x) || x == '\t')
#endif

#ifndef HAVE_STRCASESTR
#ifndef RTS2_HAVE_STRCASESTR
char * strcasestr(const char * haystack, const char * needle);
#endif

Expand Down Expand Up @@ -276,7 +276,7 @@ struct ci_char_traits : public std::char_traits<char>

typedef std::basic_string<char, ci_char_traits> ci_string;

#ifndef HAVE_GETLINE
#ifndef RTS2_HAVE_GETLINE
ssize_t getline(char **lineptr, size_t *n, FILE *stream);
#endif

Expand Down
1 change: 1 addition & 0 deletions lib/libindi/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ lib_LTLIBRARIES = libindi.la
noinst_HEADERS = rts2toindi.h indicom.h lilxml.h base64.h indiapi.h indidevapi.h

libindi_la_SOURCES = rts2toindi.c indicom.c lilxml.c base64.c
libindi_la_CFLAGS = -I../../include
6 changes: 3 additions & 3 deletions lib/libindi/indicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
#include <errno.h>
#include <stdarg.h>

#include <config.h>
#include <rts2-config.h>

#ifdef HAVE_NOVA_H
#ifdef RTS2_HAVE_NOVA_H
#include <libnova.h>
#endif

Expand Down Expand Up @@ -72,7 +72,7 @@ void getSexComponents(double value, int *d, int *m, int *s);

int extractISOTime(char *timestr, struct ln_date *iso_date)
{
#ifdef HAVE_NOVA_H
#ifdef RTS2_HAVE_NOVA_H
struct tm utm;

if (strptime(timestr, "%Y/%m/%dT%H:%M:%S", &utm))
Expand Down
4 changes: 2 additions & 2 deletions lib/rts2/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ noinst_PROGRAMS = test

bin_PROGRAMS=rts2-horizon

AM_CXXFLAGS=@NOVA_CFLAGS@
AM_CFLAGS=@NOVA_CFLAGS@
AM_CXXFLAGS=@NOVA_CFLAGS@ -I../../include
AM_CFLAGS=@NOVA_CFLAGS@ -I../../include

test_SOURCES = test.cpp
test_LDADD = -lrts2 @LIB_NOVA@
Expand Down
12 changes: 6 additions & 6 deletions lib/rts2/connnotify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "connnotify.h"

#include <sys/ioctl.h>
#ifndef HAVE_INOTIFY_INIT1
#ifndef RTS2_HAVE_INOTIFY_INIT1
#include <fcntl.h>
#endif

Expand All @@ -33,14 +33,14 @@ ConnNotify::ConnNotify (rts2core::Block *_master):ConnNoSend (_master)

int ConnNotify::init ()
{
#ifdef HAVE_INOTIFY_INIT1
#ifdef RTS2_HAVE_INOTIFY_INIT1
sock = inotify_init1 (IN_NONBLOCK);
#elif defined(HAVE_SYS_INOTIFY_H)
#elif defined(RTS2_HAVE_SYS_INOTIFY_H)
sock = inotify_init ();
fcntl (sock, O_NONBLOCK);
#endif

#if defined(HAVE_INOTIFY_INIT1) || defined(HAVE_SYS_INOTIFY_H)
#if defined(RTS2_HAVE_INOTIFY_INIT1) || defined(RTS2_HAVE_SYS_INOTIFY_H)
if (sock == -1)
{
// throw Error ("cannot initialize notify FD");
Expand All @@ -56,7 +56,7 @@ int ConnNotify::receive (fd_set * readset)
{
if (sock >= 0 && FD_ISSET (sock, readset))
{
#ifdef HAVE_SYS_INOTIFY_H
#ifdef RTS2_HAVE_SYS_INOTIFY_H
int len;
if (ioctl (sock, FIONREAD, &len))
{
Expand Down Expand Up @@ -100,7 +100,7 @@ int ConnNotify::receive (fd_set * readset)

int ConnNotify::addWatch (const char *filename, uint32_t mask)
{
#ifdef HAVE_SYS_INOTIFY_H
#ifdef RTS2_HAVE_SYS_INOTIFY_H
return inotify_add_watch (sock, filename, mask);
#else
return -1;
Expand Down
6 changes: 3 additions & 3 deletions lib/rts2/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int Daemon::checkLockFile (const char *_lock_fname)
<< sendLog;
return -1;
}
#ifdef HAVE_FLOCK
#ifdef RTS2_HAVE_FLOCK
ret = flock (lock_file, LOCK_EX | LOCK_NB);
#else
ret = lockf (lock_file, F_TLOCK, 0);
Expand Down Expand Up @@ -204,7 +204,7 @@ int Daemon::doDaemonize ()
if (daemonize != DO_DAEMONIZE)
return 0;
int ret;
#ifndef HAVE_FLOCK
#ifndef RTS2_HAVE_FLOCK
// close and release lock file, as we will lock it again in child - there isn't way how to pass closed file descriptor to child without flock function
close (lock_file);
lock_file = 0;
Expand Down Expand Up @@ -254,7 +254,7 @@ int Daemon::doDaemonize ()
const char * Daemon::getLockPrefix ()
{
if (lockPrefix == NULL)
return LOCK_PREFIX;
return RTS2_LOCK_PREFIX;
return lockPrefix;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/rts2/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <netdb.h>
#include <sys/socket.h>

#include <config.h>
#include <rts2-config.h>
#include "status.h"
#include "device.h"
#include "command.h"
Expand Down Expand Up @@ -741,7 +741,7 @@ void Device::beforeRun ()
ret = doDaemonize ();
if (ret)
exit (ret);
#ifndef HAVE_FLOCK
#ifndef RTS2_HAVE_FLOCK
// reopen..
ret = checkLockFile (s.c_str ());
if (ret < 0)
Expand Down
Loading

0 comments on commit 8d7eb4b

Please sign in to comment.