当前位置: 技术问答>linux和unix
Linux c 代码里的这个变量怎么来的?
来源: 互联网 发布时间:2017-04-20
本文导语: 现在手里的一份C-ICAP代码里,有这么一行代码: char *SERVER_LOG_FILE = LOGDIR "/cicap-server.log"; 显然 LOGDIR 是目录的一部分;可是我对整个目录进行搜索,只能找到如下结果: bin/c-icap-config:9:#LOGDIR= bin/c-icap-libicapapi-config:...
现在手里的一份C-ICAP代码里,有这么一行代码:
显然 LOGDIR 是目录的一部分;可是我对整个目录进行搜索,只能找到如下结果:
我刚接触Linux c不久,请问这个LOGDIR是怎么定义的,是如何初始化为程序运行路径的?
char *SERVER_LOG_FILE = LOGDIR "/cicap-server.log";
显然 LOGDIR 是目录的一部分;可是我对整个目录进行搜索,只能找到如下结果:
bin/c-icap-config:9:#LOGDIR=
bin/c-icap-libicapapi-config:9:#LOGDIR=
c-icap:34:relink_command="(cd /home/svn_icap_src/icap/c_icap-0.2.5; { test -z "${LIBRARY_PATH+set}" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z "${COMPILER_PATH+set}" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z "${GCC_EXEC_PREFIX+set}" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z "${LD_RUN_PATH+set}" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; LD_LIBRARY_PATH=:/home/www/unixODBC/lib; export LD_LIBRARY_PATH; PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/www/unixODBC/bin/:/root/bin; export PATH; gcc -Iinclude/ -DCONFDIR=\"/home/svn_icap_src/icap/c_icap-0.2.5/etc\" -DMODSDIR=\"/home/svn_icap_src/icap/c_icap-0.2.5/lib/c_icap/\" -DSERVDIR=\"/home/svn_icap_src/icap/c_icap-0.2.5/lib/c_icap/\" -DLOGDIR=\"/home/svn_icap_src/icap/c_icap-0.2.5/var/log/\" -DDATADIR=\"/home/svn_icap_src/icap/c_icap-0.2.5/share/c_icap/\" -D_REENTRANT -g -O2 -Wall -D_FILE_OFFSET_BITS=64 -rdynamic -o $progdir/$file c_icap-aserver.o c_icap-request.o c_icap-cfg_param.o c_icap-proc_threads_queues.o c_icap-http_auth.o c_icap-access.o c_icap-log.o c_icap-service.o c_icap-module.o c_icap-commands.o c_icap-mpmt_server.o c_icap-dlib.o c_icap-info.o c_icap-default_acl.o -L/usr/local/json-c-0.9/lib ./.libs/libicapapi.so /usr/local/json-c-0.9/lib/libjson.so -Wl,-rpath -Wl,/home/svn_icap_src/icap/c_icap-0.2.5/.libs -Wl,-rpath -Wl,/usr/local/json-c-0.9/lib -Wl,-rpath -Wl,/home/svn_icap_src/icap/c_icap-0.2.5/lib -Wl,-rpath -Wl,/usr/local/json-c-0.9/lib)"
c-icap-config:9:#LOGDIR=
c-icap-config.in:9:#LOGDIR=
c-icap-libicapapi-config:9:#LOGDIR=
c-icap-libicapapi-config.in:9:#LOGDIR=
c_icap.mak:5:LOGDIR="c:\c-icap\log"
c_icap.mak:7:CI_DEFS=-DCONFDIR="$(CONFDIR)" -DSERVDIR="$(SERVDIR)" -DMODSDIR="$(MODSDIR)" -DLOGDIR="$(LOGDIR)"
docs/man/Makefile.am:6:LOGDIR=$(localstatedir)/log/
docs/man/Makefile.in:235:LOGDIR = $(localstatedir)/log/
docs/man/Makefile:235:LOGDIR = $(localstatedir)/log/
log.c:186:/*char *LOGS_DIR=LOGDIR;*/
log.c:187:char *SERVER_LOG_FILE = LOGDIR "/cicap-server.log";
log.c:188:/*char *ACCESS_LOG_FILE = LOGDIR "/cicap-access.log";*/
Makefile:356:LOGDIR = $(localstatedir)/log/
Makefile:383: -DSERVDIR="$(SERVICESDIR)" -DLOGDIR="$(LOGDIR)"
Makefile:1614: $(mkinstalldirs) $(DESTDIR)$(LOGDIR);
Makefile:1616: chgrp nogroup $(DESTDIR)$(LOGDIR) || echo -e "*********nWARNING! Can not set group for the log dir $(DESTDIR)$(LOGDIR)n*********n"
Makefile:1617: chmod 775 $(DESTDIR)$(LOGDIR)
Makefile.am:8:LOGDIR=$(localstatedir)/log/
Makefile.am:47: -DSERVDIR="$(SERVICESDIR)" -DLOGDIR="$(LOGDIR)"
Makefile.am:100: $(mkinstalldirs) $(DESTDIR)$(LOGDIR);
Makefile.am:102: chgrp nogroup $(DESTDIR)$(LOGDIR) || echo -e "*********nWARNING! Can not set group for the log dir $(DESTDIR)$(LOGDIR)n*********n"
Makefile.am:103: chmod 775 $(DESTDIR)$(LOGDIR)
Makefile.bak:356:LOGDIR = $(localstatedir)/log/
Makefile.bak:383: -DSERVDIR="$(SERVICESDIR)" -DLOGDIR="$(LOGDIR)"
Makefile.bak:1614: $(mkinstalldirs) $(DESTDIR)$(LOGDIR);
Makefile.bak:1616: chgrp nogroup $(DESTDIR)$(LOGDIR) || echo -e "*********nWARNING! Can not set group for the log dir $(DESTDIR)$(LOGDIR)n*********n"
Makefile.bak:1617: chmod 775 $(DESTDIR)$(LOGDIR)
Makefile.in:356:LOGDIR = $(localstatedir)/log/
Makefile.in:383: -DSERVDIR="$(SERVICESDIR)" -DLOGDIR="$(LOGDIR)"
Makefile.in:1614: $(mkinstalldirs) $(DESTDIR)$(LOGDIR);
Makefile.in:1616: chgrp nogroup $(DESTDIR)$(LOGDIR) || echo -e "*********nWARNING! Can not set group for the log dir $(DESTDIR)$(LOGDIR)n*********n"
Makefile.in:1617: chmod 775 $(DESTDIR)$(LOGDIR)
services/wkcash/Makefile.am:4:LOGDIR=$(localstatedir)/log/
services/wkcash/Makefile.am:9:srv_wkcash_la_CFLAGS= -I../../include/ -DLOGDIR="$(LOGDIR)" -DCONFDIR="$(CONFIGDIR)"
services/wkcash/Makefile.in:228:LOGDIR = $(localstatedir)/log/
services/wkcash/Makefile.in:231:srv_wkcash_la_CFLAGS = -I../../include/ -DLOGDIR="$(LOGDIR)" -DCONFDIR="$(CONFIGDIR)"
services/wkcash/Makefile:228:LOGDIR = $(localstatedir)/log/
services/wkcash/Makefile:231:srv_wkcash_la_CFLAGS = -I../../include/ -DLOGDIR="$(LOGDIR)" -DCONFDIR="$(CONFIGDIR)"
wk_access_log_path[0xff] = LOGDIR;
services/wkcash/srv_wkcash_log.c:21:char wk_access_log_path[0xff] = LOGDIR;
utils/Makefile.am:7:LOGDIR=$(localstatedir)/log/
utils/Makefile.in:247:LOGDIR = $(localstatedir)/log/
utils/Makefile:247:LOGDIR = $(localstatedir)/log/
我刚接触Linux c不久,请问这个LOGDIR是怎么定义的,是如何初始化为程序运行路径的?
|
Makefile:356:LOGDIR = $(localstatedir)/log/
Makefile:383: -DSERVDIR="$(SERVICESDIR)" -DLOGDIR="$(LOGDIR)"
makefile里面有LOGDIR的值,编译器通过-D 选项传参
Makefile:383: -DSERVDIR="$(SERVICESDIR)" -DLOGDIR="$(LOGDIR)"
makefile里面有LOGDIR的值,编译器通过-D 选项传参